Hello Aspose Team,
i have problems to convert the attached empty word document with Aspose.Words 16.4.0 for Java to pdf.
Here is the code snippet:
com.aspose.words.PdfSaveOptions options = new com.aspose.words.PdfSaveOptions();
options.setCompliance(com.aspose.slides.PdfCompliance.PdfA1b);
com.aspose.words.Document doc = new com.aspose.words.Document(inputStream);
doc.save(baos, options);
No document will be generated.
Hi Frederic,
Thanks for your inquiry. The shared document have 0kb file size. Could you please re-attach your input Word document again here for testing? We will investigate the issue on our side and provide you more information.
Hi Tahir,
thanks for your answer. The attached document is correct, it has 0kb size.
There will be no error message or exception when the 0KB document will be rendered and no pdf file will be written. Either an error should occur (which can be shown to the user) or a pdf document should be created.
The same happens, if i try to render the document to Pdf15.
Hi Frederic,
Thanks for sharing the detail. We have tested the scenario and have not found any issue with output Pdf. Please change com.aspose.slides.PdfCompliance.PdfA1b to com.aspose.words.PdfCompliance.PDF_A_1_B. We have attached the output Pdf with this post for your kind reference.
Document doc = new Document(MyDir + "2016-04-08-Problem-Empty-Document.docx");
com.aspose.words.PdfSaveOptions options = new com.aspose.words.PdfSaveOptions();
options.setCompliance(com.aspose.words.PdfCompliance.PDF_A_1_B);
doc.save(MyDir + "Out.pdf", options);