• Creates a PDF from one or more assets which will be merged in the given order.

    Consider using createTempPdfFromAssets if the PDF doesn't need to be persisted and isn't relevant for the finished configuration.

    Simplified helper built on top of convertDocument. Use convertDocument directly for advanced scenarios.

    Returns

    URL to the generated cfgn file, if successful

    Example

    const resultUrl = await CfgnFiles.createPdfFromAssets(
    'MyBundle',
    [
    {
    type: 'PdfAsset',
    assetPath: 'quotePdfAsset',
    context: {
    subject: 'MySubject',
    },
    },
    {
    type: 'Asset',
    assetPath: 'Pdf2',
    },
    ],
    'QuotePdf',
    `Your_quote_${new Date().toISOString()}`
    );

    Parameters

    • bundleAliasName: string

      Bundle name where the assets are stored

    • assetTasks: CreatePdfTasks[]

      One or more "assets tasks" which will be merged in the given order

    • cfgnFileName: string

      Name of the generated cfgn file

    • Optional cfgnFileDisplayName: string

      Optional name which will be used when downloading the file

    Returns Promise<string | undefined>

Generated using TypeDoc