3

SelectToPdf after conversion from html to pdf makes the font size they way smaller as it should be

I've compared it with some different html-pdf converters and they work as expected

Here are my converter settings

            {
                Options =
                {
                    EmbedFonts = true,
                    ExternalLinksEnabled = true,
                    PageBreaksEnhancedAlgorithm = true,
                    RenderingEngine = RenderingEngine.WebKit,
                    MarginTop = 40,
                }
            };

It is possible to configure that from the converter settings or that could be configured only from inside the html?

3 Answers3

0

Looks like you can do this with details from the following link:

https://selectpdf.com/demo/page-settings.aspx

Let me know if this helps

dtroy
  • 36
  • 6
  • I've checked that one before. You can apply it only for specific new `PdfTextElement` while I'm trying to convert the whole html with using `converter.ConvertHtmlString(htmlString)`. So that's not what I need exactly, or I'm missing something? – Yaroslav Smoliak Jun 21 '19 at 14:55
  • Ah right yes i see what you mean. looking through the documentation then im not sure it would be possible then unless there is a way you can add the new font and size and then apply it to the pdf. – dtroy Jun 21 '19 at 15:05
0

To increase the overall font size in PDF, you can apply the below style at top of the complete HTLM.

<div style="font-size: 1.5em;"> completeHTMLString </div>

font-size value can be changed as per need, but keep it in 'em'.

Hks
  • 1
  • 3
0

I had the same issue but was due to the WebPageWidth set too large which caused the font to be smaller due to DPI.

Try setting converter.Options.WebPageWidth to 816 = letter (8.5") at 96 DPI

https://selectpdf.com/docs/P_SelectPdf_HtmlToPdfResult_WebPageSize.htm

Steve
  • 1,995
  • 2
  • 16
  • 25