Skip to main content

createPdfFromAsset

@combeenation/custom-code-utils


Function: createPdfFromAsset()

createPdfFromAsset(bundleAliasName, pdfAssetPath, context, cfgnFileName, cfgnFileDisplayName?): Promise<string | undefined>

Creates a PDF from a given PDF asset.
This PDF asset provides the base content, which can be enriched with a context from the actual configuration.
PDF settings are also already defined in the asset.

Parameters

bundleAliasName

string

Alias name, as set in the asset bundle assignment dialog

pdfAssetPath

string

Dot seperated path, e.g. 'MyPDFFolder.MyPDFAsset'

context

object

JSON data from configuration which will be inject into the PDF asset

cfgnFileName

string

Name of the generated cfgn file

cfgnFileDisplayName?

string

Optional name which will be used when downloading the file

Returns

Promise<string | undefined>

URL to generated cfgn file