Convert to PDF
Conversion to PDF format could be triggered by following below steps:
- Create new instance of Converter class and pass source document path as a constructor parameter
- Instantiate PdfConvertOptions class.
- Call convert method of Converter class instance and pass filename for the converted document and the instance of PdfConvertOptions from the previous step.
The following code show how to convert any document to PDF.
Converter converter = new Converter("sample.docx");
PdfConvertOptions options = new PdfConvertOptions();
converter.convert("converted.pdf", options);