Create and convert a document (e.g. HTML to PDF).The conversion consists of multiple individual tasks to allow full flexibility when creating documents.
Example case: Create a PDF with dynamic content (PDF asset), append a static product datasheet.
See also createPdfFromAssets for a simplified version to create a PDF.
URL to the generated cfgn file, if successful
const resultUrl = await CfgnFiles.convertDocument([ { type: DocumentConvertTaskTypes.PdfAsset, name: 'HtmlToPdfTask', bundleAliasName: 'MyBundle', assetPath: 'quotePdfAsset', context: { subject: 'MySubject', }, }, { type: DocumentConvertTaskTypes.OutputToCfgnFile, name: 'OutputPdfTask', inputTaskName: 'HtmlToPdfTask', cfgnFileName: 'QuotePdf', cfgnFileExtension: 'pdf', cfgnFileDisplayName: `Your_quote_${new Date().toISOString()}`, },]);
The tasks are executed based on their connection with the properties name and inputTaskName (the order in the array is irrelevant)
name
inputTaskName
Generated using TypeDoc
Create and convert a document (e.g. HTML to PDF).
The conversion consists of multiple individual tasks to allow full flexibility when creating documents.
Example case: Create a PDF with dynamic content (PDF asset), append a static product datasheet.
See also createPdfFromAssets for a simplified version to create a PDF.
Returns
URL to the generated cfgn file, if successful
Example