Dear Support,
I’m reaching out for assistance in understanding how the PdfSaveOptions/PdfOptions
objects work across different Aspose libraries.
I’m currently implementing a Rendition Engine that converts various document formats to PDF. I am using the following Aspose libraries:
- Aspose.Words for RTF/TXT/DOC/DOCX documents
- Aspose.Slides for PPT/PPTX documents
- Aspose.Cells for XLS/XLSX documents
Our client has specific requirements for the output PDF documents, such as a custom ‘PDF producer’ value, document resolution, format, compression, etc. So far, I have found settings for most of these elements only in Aspose.Cells, for example:
private void convertTable(Path inputPath, Path outputPath) throws Exception {
com.aspose.cells.Workbook workbook = new com.aspose.cells.Workbook(inputPath.toString());
com.aspose.cells.PdfSaveOptions pso = new com.aspose.cells.PdfSaveOptions();
pso.setImageResample(600, 100);
pso.setProducer("Test company");
pso.setPdfCompression(3);
workbook.save(outputPath.toString(), pso);
}
After thoroughly reviewing the documentation and internal Aspose code, I have noticed that different Aspose libraries offer different customization options for PdfSaveOptions/PdfOptions
. I can find these object, but they don’t have much settings I need, for example:
private void convertText(Path inputPath, Path outputPath) throws Exception {
com.aspose.words.Document document = new com.aspose.words.Document(inputPath.toString());
com.aspose.words.PdfSaveOptions pso = new com.aspose.words.PdfSaveOptions();
document.save(outputPath.toString(), pso);
}
private void convertPres(Path inputPath, Path outputPath) {
com.aspose.slides.Presentation presentation = new com.aspose.slides.Presentation(inputPath.toString());
com.aspose.slides.PdfOptions po = new com.aspose.slides.PdfOptions();
try {
presentation.save(outputPath.toString(), SaveFormat.Pdf, po);
} finally {
presentation.dispose();
}
}
Could you please advise if there is a universal approach that allows me to apply the same required settings across all document types?
I’m using an Aspose.Total license, so I have access to all your libraries.
Thank you in advance for your support!