While Converting HTML to PDF the font size of text in the PDF content is becoming smaller

Hi,

I am trying to convert html to pdf using Aspose.PDF for .Net. Please find attached the HTML file and the PDF file . The font size mentioned in html file do not match with the font size of PDF. In PDF the font size is smaller. I am using Aspose.Pdf version 11.7 .
Please see the code snippet which I am using to do the same :

public byte[] ConvertHTMLToPDFWithAspose(string sHTML)
{
MSIO.MemoryStream msoutput = new MSIO.MemoryStream();
byte[] byteOutputStream = null;
Aspose.Pdf.Document doc = null;
Aspose.Pdf.HtmlLoadOptions htmloptions = new Aspose.Pdf.HtmlLoadOptions();
htmloptions.PageInfo.Width = Aspose.Pdf.Generator.PageSize.LetterWidth;
htmloptions.PageInfo.Height = Aspose.Pdf.Generator.PageSize.LetterHeight;
htmloptions.PageInfo.Margin.Left = htmloptions.PageInfo.Margin.Right = 0;
htmloptions.PageInfo.Margin.Top = htmloptions.PageInfo.Margin.Bottom = 10;
using (MSIO.Stream s = GenerateStreamFromString(sHTML))
{
doc = new Aspose.Pdf.Document(s, htmloptions);
doc.FitWindow = true;
doc.Save(msoutput, Aspose.Pdf.SaveFormat.Pdf);
}
byteOutputStream = msoutput.GetBuffer();
msoutput.Close();
msoutput.Dispose();
return byteOutputStream;
}

Please let me know if there is any resolution to this problem.

Regards,
Soumyabroto Bhowmik

Hi,


Any update on this issue ? If this issue can be resolved , then only we can use Aspose product in our company. Hence, it is little urgent. We have to implement export functionalities and for that we are looking for products which can consume HTML and give us PDF, DOCX and RTF.

Regards,
Soumyabroto Bhowmik


Hi Soumyabroto,


Thanks for your interest in Aspose. I will appreciate it if you please share some more details about the issue. As I am afraid I am unable to noticed small font size in resultant PDF, rather if we view HTML and PDF files with 100% view it seems fonts in PDF are larger than HTML.

We are sorry for the inconvenience caused.

Best Regards,

Hi Tilal,

To verify the font size, I opened the html file in browser and checked the font size of the heading “Soumyabroto1” , using developer options , the font size is 30.
To verify the font size of the PDF document , I copied the heading “Soumyabroto1” and pasted it in a Word document, and checked the font size, it shows 22.5 .

Please find attached the screenshots of the same.

Hi Tilal,


I think I have understood the issue. Aspose is converting pixels to equivalents points. 30 px <=> 22.5 pts .

Now, is there any way to magnify the output without changing the font sizes of the html ? Any way by which I can set any specific property which would magnify the font sizes of the PDF output by specified percentage ?
Please let me know if it is possible.

Regards,
Soumyabroto

Hi Soumyabroto,


Thanks for sharing the additional details. After initial investigation, we have logged a ticket PDFNET-41078 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,