We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

JAVA Converting from PDF to TeX doesn't work on LINUX

Hi, I have to convert a file from PDF to TeX. Everything works good on Windows when I run the application locally. On the server where the app implemented is hosted(AMAZON EC-2 LINUX), the same method doesn’t work anymore.

The code from JAVA:
Document pdfDocument = new Document(doc.getPath());
pdfDocument.save(insuranceDir + “ALLIANZ”, SaveFormat.TeX);

The ERROR:
java.lang.NullPointerException: null
at com.aspose.pdf.internal.l52v.lf.lf(Unknown Source)
at com.aspose.pdf.internal.l52v.lb.lb(Unknown Source)
at com.aspose.pdf.internal.l52v.lb.lI(Unknown Source)
at com.aspose.pdf.internal.l52v.lb.lj(Unknown Source)
at com.aspose.pdf.internal.l52v.lj.lj(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51f.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l51l.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l51l.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l51l.lf.lI(Unknown Source)
at com.aspose.pdf.l17v.lI(Unknown Source)
at com.aspose.pdf.l17v.lI(Unknown Source)
at com.aspose.pdf.ADocument.lj(Unknown Source)
at com.aspose.pdf.ADocument.lj(Unknown Source)
at com.aspose.pdf.ADocument.lf(Unknown Source)
at com.aspose.pdf.Document.lf(Unknown Source)
at com.aspose.pdf.ADocument.lI(Unknown Source)
at com.aspose.pdf.ADocument.save(Unknown Source)
at com.aspose.pdf.Document.save(Unknown Source)

In usr/share/fonts -> I created truetype directory -> I created msttcorefonts directory -> I put all my local windows fonts there.

  • I installed libgdiplus, still the same error. Suggestions?

@NicolasLesanu

Please try to use FontRepository.setLocalFontPaths(fontPaths); method before calling the conversion method. In case issue still persists, please share your sample PDF with us and complete details of Linux version. Also, please make sure to use 22.12 version of the API. We will further proceed to assist you accordingly.

Thank you very much. You can mark it as solved. I used setLocalFontPaths where I put my path + I upgraded to 22.12, now it works.