Word Documents to PDF (DOC to PDF) Conversion in .NET


/ Published in: C#
Save to your folder(s)

The code sample below converts a whole document from DOC to PDF using default options.


Copy this code and paste it in your HTML
  1. C# Code Snippet
  2. ===============
  3.  
  4. // For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET
  5. // The path to the documents directory.
  6. string dataDir = RunExamples.GetDataDir_QuickStart();
  7.  
  8. // Load the document from disk.
  9. Document doc = new Document(dataDir + "Template.doc");
  10.  
  11. dataDir = dataDir + "Template_out_.pdf";
  12.  
  13. // Save the document in PDF format.
  14. doc.Save(dataDir);
  15.  
  16.  
  17. VB.NET Code Snippet
  18. ===================
  19.  
  20. ' For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET
  21. ' The path to the documents directory.
  22. Dim dataDir As String = RunExamples.GetDataDir_QuickStart()
  23.  
  24. ' Load the document from disk.
  25. Dim doc As New Document(dataDir & "Template.doc")
  26.  
  27. dataDir = dataDir & "Template_out_.pdf"
  28. ' Save the document in PDF format.
  29. doc.Save(dataDir)

URL: http://goo.gl/OW5rWs

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.