Zum Hauptinhalt springen

FileCoverTemplate

This template class generates a file cover html.

tipp

If no fileCoverOptions provided, only the fields in FileCover will be displayed.

This template uses custom partials, that needed to register

const template = new FileCoverTemplate(docFile);
const result = template.build();
const compiler = new TemplateCompiler(result.template, result.data);
result.registerCustomPartials(compiler.handlebarCompiler);
context.returnValue = compiler.compile();

Type Parameters

TFileTypeName

TFileTypeName extends FileTypeName

TFileType

TFileType extends FileType<TFileTypeName>

Implements

Constructors

Constructor

new FileCoverTemplate<TFileTypeName, TFileType>(file): FileCoverTemplate<TFileTypeName, TFileType>

Parameters

file

TFileType

The docFile you want to use

Returns

FileCoverTemplate<TFileTypeName, TFileType>

Properties

IGNORED_TYPES

static IGNORED_TYPES: FieldTypes[]

Methods

includeFields()

includeFields(fields): FileCoverTemplate<TFileTypeName, TFileType>

Parameters

fields

string[]

Returns

FileCoverTemplate<TFileTypeName, TFileType>


excludeFields()

excludeFields(fields): FileCoverTemplate<TFileTypeName, TFileType>

Parameters

fields

string[]

Returns

FileCoverTemplate<TFileTypeName, TFileType>


includeMultiTable()

includeMultiTable(field): FileCoverTemplate<TFileTypeName, TFileType>

Parameters

field
fieldName

string

columns

string[]

Returns

FileCoverTemplate<TFileTypeName, TFileType>


withCustomHeader()

withCustomHeader(html): FileCoverTemplate<TFileTypeName, TFileType>

Parameters

html

string

Returns

FileCoverTemplate<TFileTypeName, TFileType>


withCustomFooter()

withCustomFooter(html): FileCoverTemplate<TFileTypeName, TFileType>

Parameters

html

string

Returns

FileCoverTemplate<TFileTypeName, TFileType>


renderAsPdf()

renderAsPdf(options?): FileCoverTemplate<TFileTypeName, TFileType>

Parameters

options?
withFooter

boolean

Returns

FileCoverTemplate<TFileTypeName, TFileType>


build()

build(): TemplateBuildResult

Returns

TemplateBuildResult

Implementation of

ITemplateFactory.build