Free Support Forum -

Saving a word document in different formats?

We are using Aspose.Words to create and/or update word documents and save them, it works great, however we would like to be able to save as PDF as well. When we purchased the product we were under the impression this would work, if we get the Aspose.PDF license as well as the Aspose.Words product will the following be possible?

Document doc = new Document()“word.doc”);“adobe.pdf”);



<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Currently Aspose.Words supports direct conversion to PDF (without using Aspose.Pdf). See the following link for more information:

So, you can try using direct method to convert your document to PDF. Here is the code:

Document doc = new Document("in.doc");


Best regards,

I Must be missing something as there appears to be no Document.saveToPdf() function. I have double checked the documentation and it does not show there is a saveToPdf method either.

I downloaded a fresh version of aspose words yesterday so I must have the right version, the jar is called "Aspose.Words.jdk16.jar"

Currently my code is working like this:

WordExport exporter = new WordExport();
Document document = exporter.export(policy);
response.setContentType(“application/msword”);, SaveFormat.DOC);

However this doesn’t work as there is no “SaveFormat.PDF”:

WordExport exporter = new WordExport();
Document document = exporter.export(policy);
response.setContentType(“application/pdf”);, SaveFormat.PDF);

So I have tried making a test class to try to get it to work, the following results in generating a doc, but not a pdf:

Document doc = new Document()
… add some test stuff…“test.doc”);“test.pdf”);

When it gets to the pdf it says:

java.lang.UnsupportedOperationException: Unsupported SaveFormat: .pdf
at Test2.create(
at Test2.main(

Is there some trick to it we dont know about?


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. This feature is currently in beta, that is why it is not described in the documentation. However, it is described on in the download notes of the latest version:

Please make sure you are using the latest version. To check version of Aspose.Words for java, unzip Aspose.Words.jar, open META-INF\ MANIFEST.MF file in notepad, you will see the following:

Manifest-Version: 1.0

Specification-Title: Aspose.Words for Java

Implementation-Title: Aspose.Words for Java



Specification-Vendor: Aspose Pty Ltd

Implementation-Vendor: Aspose Pty Ltd

Copyright: Copyright 2003-2009 Aspose Pty Ltd

Best regards,