To resolve the issue of missing external .tex files and EPS files during the conversion of your TeX file to PDF using Aspose, you can follow these steps:
Ensure File Accessibility: Make sure that all external TeX files, such as epsf.tex, are accessible in the working directory specified in your conversion options. The Aspose TeX engine needs to locate these files to process them correctly.
Set Working Directory: When configuring your conversion options, specify the output working directory where the Aspose TeX engine can find the required files. This can be done using the setOutputWorkingDirectory method in your code. For example:
Include EPS Files: If you have EPS files that are not appearing in the converted PDF, ensure that these files are also located in the specified working directory. The TeX engine needs to access these files during the conversion process.
Check File Paths: Verify that the paths to your input TeX file and any external files are correct. Incorrect paths can lead to the engine being unable to find the necessary files.
Example Code: Here is a simplified example of how to set up the conversion:
import java.io.FileOutputStream;
import java.io.IOException;
import com.aspose.tex.OutputFileSystemDirectory;
import com.aspose.tex.TeXConfig;
import com.aspose.tex.TeXJob;
import com.aspose.tex.TeXOptions;
import com.aspose.tex.rendering.PdfDevice;
import com.aspose.tex.rendering.PdfSaveOptions;
public class TeXToPdfConversion {
public static void main(String[] args) throws IOException {
final OutputStream pdfStream = new FileOutputStream("output.pdf");
try {
TeXOptions options = TeXOptions.consoleAppOptions(TeXConfig.objectLaTeX());
options.setOutputWorkingDirectory(new OutputFileSystemDirectory("path/to/your/working/directory"));
options.setSaveOptions(new PdfSaveOptions());
new TeXJob("path/to/your/input.tex", new PdfDevice(pdfStream), options).run();
} finally {
if (pdfStream != null) pdfStream.close();
}
}
}
By ensuring that all necessary files are in the correct locations and that your working directory is properly set, you should be able to resolve the errors you are encountering during the conversion process.
If you continue to face issues, please provide additional details about the specific errors or behaviors you are observing.
Please, provide us with your .tex and *.eps files to investigate the issue. Downloading dependent files from internet is possible by writing custom implementation of IInputWorkingDirectory as it is described here.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.