We are using Aspose.PDF library mostly for HTML to PDF conversion. But now we have to create a PDF from word format (doc or docx). Is such a conversion possible from WORD to PDF using the only Aspose.PDF library?
Thanks
We are using Aspose.PDF library mostly for HTML to PDF conversion. But now we have to create a PDF from word format (doc or docx). Is such a conversion possible from WORD to PDF using the only Aspose.PDF library?
Thanks
To convert Word documents (DOC or DOCX) to PDF using Aspose, you will need to use the Aspose.Words library, as the Aspose.PDF library is primarily designed for PDF manipulation and conversion from other formats like HTML.
Here’s a simple example of how you can perform the conversion using Aspose.Words:
// Load the Word document
Document doc = new Document("input.docx");
// Save the document as a PDF
doc.Save("output.pdf", SaveFormat.Pdf);
In this code snippet, you first load the Word document using the Document
class from the Aspose.Words library, and then you save it in PDF format using the Save
method.
If you are specifically looking to use only the Aspose.PDF library, it does not support direct conversion from Word formats to PDF. Therefore, you will need to incorporate Aspose.Words for this task.
For more detailed information, you can refer to the official Aspose documentation on converting documents.
If you have any further questions or need assistance with specific code implementations, feel free to ask!