Free Support Forum - aspose.com

Export document to PDF

I have licence for Aspose Words. On desctiption page of Aspose Words there is written that I can export Document to PDF. But in code there is no PDF member of SaveFormat enum. There is only AsposePdf which is not working in Adobe Reader. How to export word document to PDF which users can open using standard PDF reading software?


Aspose.Words.Document d = new Document(Server.MapPath(“aaa.doc”));
d.Save(Server.MapPath(“aaa.pdf”),SaveFormat.AsposePdf);



Hi Maciej,


Thanks for your inquiry. Yes, Aspose.Words supports the MS Word document to PDF conversion. Please read Aspose.Words LoadFormat and SaveFormat form following documentation links.
http://www.aspose.com/docs/display/wordsnet/LoadFormat+Enumeration
http://www.aspose.com/docs/display/wordsnet/SaveFormat+Enumeration

Please check the following documentation links for detail:
http://www.aspose.com/docs/display/wordsnet/How+to++Convert+a+Document+to+PDF
http://www.aspose.com/docs/display/wordsnet/Loading%2C+Saving+and+Converting

<span lang=“EN-GB” style=“font-size:10.0pt;font-family:“Courier New”;color:#2B91AF;mso-font-kerning:
0pt;mso-no-proof:yes”>Document<span lang=“EN-GB” style=“font-size:10.0pt;
font-family:“Courier New”;mso-font-kerning:0pt;mso-no-proof:yes”> doc = new Document(MyDir

  • “in.docx”);<o:p></o:p>

doc.Save(MyDir + "AsposeOut.PDF");

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

Hi,


Sorry it is not working. Following code still saves document in some strange format. When I view the file I can see the XML structure which is not valid PDF format structure.

And I can not open it in normal Adobe Reader.

Hi Maciej,


Could you please attach your input Word document here for testing? I will investigate the issue on my side and provide you more information.