Copy link to clipboard
Copied
Hi,
I have specified a font size in css class and same is used in htmldocument,
Trying to generate a pdf in c# code for the htmldocument.
I have provided 26px as font size but after generating a pdf, the font size reduces to 24 px.
Similarly for 24px, the pdf shows content in 21 px.
Why there is such discrepancy ?
Copy link to clipboard
Copied
Also, at times it increases the font size.
I had given 13px and in pdf it got changed to 16px.
Sometimes it reduces and at times increased. Why does that happen ??
Copy link to clipboard
Copied
How does you create the documents?
Copy link to clipboard
Copied
HtmlToPdfDocument
above class is used with specifying the outputformat as
GlobalSettings.DocumentOutputFormat.PDF
var document = new HtmlToPdfDocument
{
GlobalSettings =
{
ProduceOutline = true,
DocumentTitle = "ClinDoc Notes-" + updatedDoc.id,
PaperSize = System.Drawing.Printing.PaperKind.Letter,
Margins = marginSettings,
OutputFormat = GlobalSettings.DocumentOutputFormat.PDF,
},
Objects = {
new ObjectSettings {
HtmlText = htmlStr, // this is the htmlcontent
FooterSettings = footerSettings,
CountPages = true,
ProduceExternalLinks = true,
WebSettings = new WebSettings
{
LoadImages = true,
PrintMediaType = true,
DefaultEncoding = "utf8",
PrintBackground = true,
}
}
}
Copy link to clipboard
Copied
html content had the font size spcified
Copy link to clipboard
Copied
Why does you post this in the forum for Adobe Acrobat?
Copy link to clipboard
Copied
bceuae this is a html to pdf conversion.
So while creating html, we r specifying a proper font size but when it gets converted to pdf, it shows wrong font size
Copy link to clipboard
Copied
That doesn’t answer the question. This forum is for people using Adobe Acrobat. Perhaps you aren’t aware that PDF is a public standard and anyone can make software to work with PDF files, without Acrobat. You need to contact support for the product you are using to do the conversion. If it’s some free.open source thing you found you may have to fix it yourself.
Copy link to clipboard
Copied
Adobe Acrobat shows the font size which are in the PDF file.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more