I’m using Aspose.Words 4.0.2 for Java. When I try to save a document to a PDF file, all the text content looks great, but if the document includes any PNG images, those images come out completely garbled. Are embedded PNGs currently not supported for PDF output? They look great when I output in DOC, DOCX, or RTF formats.
Here’s the code I use to generate the output files:
InputStream is = new FileInputStream("test_files/images/images.html");
Document doc = new Document(is, "test_files/images");
is.close();
doc.save("test_files/images_output.doc");
doc.save("test_files/images_output.docx");
doc.save("test_files/images_output.rtf");
doc.saveToPdf("test_files/images_output.pdf");
I’m attaching the images.html file, source images (one PNG and one JPG), and the output PDF in a zip file.
Thanks,
Matt
Hi Matthew,
Thanks for attaching your documents. Exporting to PDF in Java is still in beta right now so the handling of .png is not properly supported yet. Currently we are working on synchronizing Java and .NET versions of Aspose.Words. Once completed all image types that are available in .NET including .png should be working for Java. You will be notified as soon as this is available.
Thanks,
Thanks Adam. Any idea how long the synchronizing is likely to take? Also, does this same limitation exist in Aspose.PDF for Java, or just in the PDF functionality within Aspose.Words?
–Matt
Hi Matthew,
Thanks for your inquiry. Hopefully synchronization work will be finished sometime in the end of May. You will be notified. Regarding Aspose.Pdf for Java you can ask your question in the appropriate forum.
Best regards,
We are happy to inform you that the first auto-ported version of Aspose.Words for Java is ready. This version supports converting documents to PDF. You can get it from here.
Best regards,
Aspose.Words team
(91)