Free Support Forum - aspose.com

Convert HTML to PDF Linux


#1

Dears,

We have the Aspose License that we are using for a long time. (Company Name: Everteam)
We are having troubles converting an HTML to PDF on Linux using the following code:

//Convert HTML file to PDF
String basePath = “pdftest”;
HtmlLoadOptions htmloptions = new HtmlLoadOptions(basePath);
Document doc = new Document(htmlFile.getAbsolutePath(),htmloptions);
File resultingPDFFile = new File(“MyFile”);
doc.save(resultingPDFFile.getAbsolutePath());

The problem is the following:

  • The PDF is generated correctly on windows but not on Linux.

You can find attached the environment specifications:
JFiles.zip (191.2 KB)
E.png and Linux_OS.png.

The aspose library we are using is: aspose-pdf-18.9.1.jar

Also attached you can find the two PDF generated on Linux and windows so you can check the difference between them.

Thanks in advance,


#2

@Emilee

Thanks for contacting support.

We have tested the scenario in Linux environment using Aspose.PDF for Java 19.2. We were unable to notice the issue which were present in the output PDF shared by you. For your kind reference, an output PDF is also attached which was generated at our side.
ToConvert.pdf (38.1 KB)

It seems that issue is related to missing fonts in your Linux Environment. Would you please make sure to install all basic fonts in your system and try with latest version of the API. In case issue still persists, please feel free to let us know.


#3

Dear,

Many thanks for your reply.
I will try to install the missing fonts and get back to you.

Best Regards,


#4

@Emilee

Sure, please take your time while testing the things at your end and share your feedback with us.