GroupDocs.Assembly can save an assembled document in a format other than the format of its template. The target file format is determined either by the extension of the output file or by explicit specifying. You can change the target file format when assembling the following kinds of documents:
Word Processing documents
Spreadsheet documents
Presentation documents
Email documents
Text documents
Supported output file formats depending on input file formats are listed on the Supported Document Formats page.
The examples below use the SimpleDatasetDemo.docx template and the ManagerData.json data described in Working with JSON Data Sources.
Changing target file format using file extension
When the output is a file path, the engine picks the format from its extension. Here, a DOCX template is saved as PDF:
Changing target file format using explicit specifying
Pass a LoadSaveOptions instance created with a FileFormat value to set the target format explicitly. The explicit format takes effect regardless of the output file extension (or its absence).