Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The ability to easily and reliably convert documents from one format to another is one of the main feature areas of Aspose.Words. Such a conversion is nothing more than a combination of loading and saving operations.
Almost any task that you want to perform with Aspose.Words involves loading or saving a document in some format. As mentioned in previous sections, the LoadFormat enumeration specifies all load or import formats supported by Aspose.Words, and the SaveFormat enumeration specifies all save or export formats supported by Aspose.Words. Thus, Aspose.Words can convert a document from any supported load format into any supported save format. As a rule, such a conversion requires several stages of calculation. However from the user perspective conversion from a document format to another one is itself very simple, and can be accomplished with just two steps:
Try online
You can try this functionality with our Free online converter.
The current section describes popular conversions, as well as ideas for working with some combinations of formats when loading and saving. Using the examples of this section, you can understand that the conversion process itself is quite universal, and there is no point in describing all the possible options, since there are several hundred of them due to the large number of formats supported by Aspose.Words for Java.
Q: How do I convert a Word document to PDF using Aspose.Words for Java?
A: Load the source file with Document doc = new Document("input.docx"); and then call doc.save("output.pdf", SaveFormat.PDF);. The SaveFormat enumeration defines the target format.
Q: Which file formats can Aspose.Words for Java load and save?
A: The library supports dozens of formats. Loading formats are listed in the LoadFormat enum (e.g., DOC, DOCX, RTF, ODT, HTML, MHTML, MD, TXT). Saving formats are listed in the SaveFormat enum (e.g., PDF, PNG, JPEG, HTML, EPUB, MD, TXT). See the supported‑document‑formats page for the full list.
Q: Can I convert a Markdown file to PDF or Word directly?
A: Yes. Load the Markdown file with Document doc = new Document("input.md"); and then save it to the desired format, for example doc.save("output.pdf", SaveFormat.PDF); or doc.save("output.docx", SaveFormat.DOCX);.
Q: How do I convert a password‑protected document?
A: First set the password on the LoadOptions object, load the document, then save it without the password (or with a new one). Example:
LoadOptions loadOptions = new LoadOptions();
loadOptions.setPassword("oldPassword");
Document doc = new Document("protected.docx", loadOptions);
doc.save("unprotected.pdf", SaveFormat.PDF);
Q: Do I need a license to perform document conversion in production?
A: A license is not required for basic conversion, but without a license the output will contain a watermark and evaluation limits apply. Apply a license by loading the .lic file with License license = new License(); license.setLicense("Aspose.Words.Java.lic");. This removes watermarks and unlocks full functionality.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.