Reputation: 1
I tried to convert html to pdf by using DinkToPDF.
Unfortunately the pdf result is different than source HTML.
Here are my DinkToPdf settings:
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" }
};
Sample Source HTML
Sample PDF result
Is it a bug? Or is there something wrong with my code?
Upvotes: 0
Views: 4061
Reputation: 830
Its not a Bug. As explained by @zvons, it wont support Modern CSS like Flexbox. Further there are many Global settings which alter font depth, spacing etc. between characters.
Eg: DPI is important setting for PDF. This cant be done from CSS. Alter Global settings to achieve the result.
Upvotes: 0