rdvojmoc / DinkToPdf

C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
MIT License
1.09k stars 417 forks source link

Issue when converting html to pdf #118

Open farrelwp opened 4 years ago

farrelwp commented 4 years ago

I tried to convert using DinkToPDF but the PDF result is different than my HTML when i open in my browser,

Here's my DinkToPdf Setting:

     [ var globalSettings = new GlobalSettings
        {
            ColorMode = ColorMode.Color,
            Orientation = Orientation.Portrait,
            PaperSize = PaperKind.A4,
            DocumentTitle = title,
            Out = string.Empty,
        };

        var objectSettings = new ObjectSettings
        {
            PagesCount = true,
            HtmlContent = htmlBody,
            WebSettings = { DefaultEncoding = "utf-8" }
        };]

This is my html and pdf result: Html :

html

PDF Result:

pdf

is it a bug?or there's something wrong with my css/html code