Could you lead me to the documentation on how to export document as a pdf?

0
danvonfeldt posted this 20 September 2017

Could you lead me to the documentation on how to export document as a pdf?

29 Posts
29 Points
2 Comments
Order By: Standard | Newest | Votes
1
jles posted this 21 September 2017

Hi,

If you are looking for a way to specify the output format with DocumentaGenerator when generating a report from a template document, then you can use one of the GenerateDocument overloads that accepts SaveOptions:

http://www.docentric.com/documentation/programming/reference-guide/docentric.documents.reporting/documentgenerator

http://www.docentric.com/documentation/programming/reference-guide/docentric.documents.reporting/documentgenerator/generatedocument3

myDocumentGenerator.GenerateDocument("MyTemplate.docx", "GeneratedDocument.pdf", Docentric.Documents.ObjectModel.SaveOptions.Pdf);

But if you would like to know how to convert an arbitrary Word (.docx) document to a PDF, use the code snippet below:

using Docentric.Documents.ObjectModel;

Document document = Document.Load(@"c:\MyWordDocument.docx");
document.Save(@"MyPdfDocument.pdf");

Let me know if any of the above is the answer to your question.

Best regards,

Jure Leskovec

155 Posts
295 Points
0
danvonfeldt posted this 22 September 2017

Thanks! The Xml.Linq.SaveOptions was clouding my view:)

29 Posts
29 Points

Our 228915 members have posted 344 times in 102 discussions