Aspose PDF LaTex Conversion - Java Version

Hi


I noticed that the .NET version of Aspose.Pdf is now documented as supporting LaTex to PDF conversion. I was wondering if/when the Java version is likely to follow suit.

I gave it a try with the current version with the following code:

com.aspose.pdf.LatexLoadOptions latexOptions = new com.aspose.pdf.LatexLoadOptions();
com.aspose.pdf.Document doc = new com.aspose.pdf.Document(inputlatexFile, latexOptions);
doc.save(outputPDFFile);

However it gave the following exception:

Exception in thread “main” com.aspose.pdf.internal.foundation.converter.latex2aps.z1: com.aspose.pdf.internal.p240.z4: Formulas with math environment “$$

If you don’t want your equation to be centered, but you want the nice
indicies and all that, you can use \verb|\displaystyle| and get your
formula in-line''; using our example this is </font></div><div><font face="Courier New" size="2" color="#000080">$" are not maintained! Use text environment instead, e.g. $1+1=2$</font></div><div><font face="Courier New" size="2" color="#000080"><span class="Apple-tab-span" style="white-space:pre"> </span>at com.aspose.pdf.internal.foundation.converter.latex2aps.z3.m1(Unknown Source)</font></div><div><font face="Courier New" size="2" color="#000080"><span class="Apple-tab-span" style="white-space:pre"> </span>at com.aspose.pdf.z49.m1(Unknown Source)</font></div><div><font face="Courier New" size="2" color="#000080"><span class="Apple-tab-span" style="white-space:pre"> </span>at com.aspose.pdf.ADocument.m1(Unknown Source)</font></div><div><font face="Courier New" size="2" color="#000080"><span class="Apple-tab-span" style="white-space:pre"> </span>at com.aspose.pdf.ADocument.<init>(Unknown Source)</font></div><div><font face="Courier New" size="2" color="#000080"><span class="Apple-tab-span" style="white-space:pre"> </span>at com.aspose.pdf.Document.<init>(Unknown Source)</font></div><div><font face="Courier New" size="2" color="#000080"><span class="Apple-tab-span" style="white-space:pre"> </span>at com.elsevier.evise.pdftest.PDFAppUsingAspose.convertLaTex(PDFAppUsingAspose.java:32)</font></div><div><font face="Courier New" size="2" color="#000080"><span class="Apple-tab-span" style="white-space:pre"> </span>at com.elsevier.evise.pdftest.PDFTools.main(PDFTools.java:64)</font></div><div><font face="Courier New" size="2" color="#000080">Caused by: com.aspose.pdf.internal.p240.z4: Formulas with math environment "$$</font></div><div><font face="Courier New" size="2" color="#000080"><br></font></div><div><font face="Courier New" size="2" color="#000080">If you don't want your equation to be centered, but you want the nice </font></div><div><font face="Courier New" size="2" color="#000080">indicies and all that, you can use \verb|\displaystyle| and get your </font></div><div><font face="Courier New" size="2" color="#000080">formulain-line’’; using our example this is
$” are not maintained! Use text environment instead, e.g. $1+1=2$
at com.aspose.pdf.internal.p240.z3.m1(Unknown Source)
at com.aspose.pdf.internal.p246.z19.m1(Unknown Source)
at com.aspose.pdf.internal.p246.z42.m3(Unknown Source)
at com.aspose.pdf.internal.p238.z1.m2(Unknown Source)
at com.aspose.pdf.internal.p238.z1.m5(Unknown Source)
at com.aspose.pdf.internal.p238.z1.m5(Unknown Source)
… 7 more

Can you give me any advice? I enclose the LaTex source file I tested with.

Many thanks, Richard.

Hi Richard,

Thanks for your inquiry. I have tested your scenario with shared document using Aspose.Pdf for Java 11 .0 .0 and managed to observe the reported issue. For further investigation, I have logged an issue in our issue tracking system as PDFNEWJAVA - 35352 and also linked your request to it . We will keep you updated about issue resolution process via this thread regarding the issue status.

We are sorry for the inconvenience caused.

Best Regards,