The source code in below examples uses some methods defined in Working with Common Operations
conversionHandler.convert() method is used in all example code to convert document to desired document format by providing input document and DocumentSaveOption object for output Document Options.
Convert and Get File Path
Convert a document/file to Pdf PDF format and get output as file path. When converting to a PDF document you can set PDF formatting options. You can set following formats using PdfFormatingOptions: