Free Support Forum - aspose.com

Create a .PDF Document from an existing .Doc Document

Hello

I am currently creating word documents using aspose.words. The resulting documents are saved and displayed to the user in a gridview where the filename and location can be recovered. I would like to create a pdf file using these already existing .Doc files. I see how to SaveAsPdf when I create a document via MailMerge, but I can not figure out how to generate a pdf from an existing .Doc file.

Can anyone help me with this?

David

Hi David,

Thanks for your request.
You just need to open existing DOC file and then save it to PDF.

Document doc = new Document(@"Existing.doc");
doc.SaveToPdf(@"out.pdf");

Regards,

Perfect!

Thanks

David