Latex File types not converting

the mentioned latexlatexFiles.zip (55.1 KB)
files are not converting .

code snippet:
String texFileName = getFileNameWithoutExtension(outputFileName) + TEX_EXTENSION;
String texFilePath = directoryPath + PATH_SEPARATOR + texFileName;
Files.copy(inputStream, Path.of(texFilePath), StandardCopyOption.REPLACE_EXISTING);

        TeXLoadOptions teXLoadOptions = new TeXLoadOptions();
       
        Document document = new Document(texFilePath, teXLoadOptions);
        PdfPageEditor pageEditor = new PdfPageEditor();
        pageEditor.bindPdf(document);
        pageEditor.setPageSize(PageSize.getA4());
        // Save to PDF
        pageEditor.save(directoryPath + PATH_SEPARATOR + outputFileName);
        pageEditor.close();

aspose version:

com.aspose aspose-total 23.8 pom please check and let us know .

@TandFSP
What editor did you use to view the attached files? I tried to open them with help TeXworks - they do not building.

Hi @sergei.shibanov These are the user-uploaded files into our product. we are also unable to open it. if these files are not valid. Is there any way to validate latex before compilation?

@TandFSP
latex is checked only by the compilation. Some version of the compiler may not work correctly - the easiest way to determine this is by comparison. I liked the comparison with the code - to check that it works correctly, you need to run it.

1 Like

hi, @sergei.shibanov we are not restricting users from uploading latex files. can you provide some code samples to validate the latex file during compilation (an easy way to validate during compilation)?

@TandFSP
I will clarify some questions and write to you tomorrow.

1 Like

@TandFSP
The obvious answer: “Run the conversion and if there are errors, it means either there is something wrong with the file or there is an error in the library. To check the library, you can start building the document with another tool.”
But there seems to be no simple automated way to determine how the conversion worked. There is a log file, but it needs to be parsed and analyzed. What additional opportunities would you see that should be implemented? Should I have some kind of flag indicating that everything went without obvious errors or something else?

@TandFSP
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-55738

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@TandFSP
The task is expected to be closed in version 24.02
To TeXLoadOptions added GetLoadResult() metod
Usage example:

var teXLoadOptions = new TeXLoadOptions();
TeXLoadResult res = teXLoadOptions.GetLoadResult(); // res is TeXLoadResult.NotExecuted

teXLoadOptions.OutputDirectory = new TeXFileSystemOutputDirectory(Path); 
var document = new Document(fullFileName, teXLoadOptions);
res = teXLoadOptions.GetLoadResult();   // res is some of TeXLoadResult

The issues you have found earlier (filed as PDFNET-55738) have been fixed in Aspose.PDF for .NET 24.2.