Skip to main content

QPdfTemplate

@quik/pdf


@quik/pdf / QPdfTemplate

Abstract Class: QPdfTemplate<TParameters>

Defined in: pdf/src/QPdfTemplate.ts:11

Base class for PDF templates.

Extends​

  • QObject

Type Parameters​

TParameters​

TParameters extends ObjectLiteral = ObjectLiteral

Shape of the parameters object accepted by the template.

Constructors​

Constructor​

protected new QPdfTemplate<TParameters>(templateName, parameters?): QPdfTemplate<TParameters>

Defined in: pdf/src/QPdfTemplate.ts:18

Create a new PDF template instance.

Parameters​

templateName​

string

Template name registered in PdfTemplatesStore.

parameters?​

TParameters

Optional parameters passed to the template.

Returns​

QPdfTemplate<TParameters>

Overrides​

QObject.constructor

Accessors​

logger​

Get Signature​

get protected logger(): IQLogger

Defined in: core/src/QObject.ts:15

The logger getter for the object.

Returns​

IQLogger

Inherited from​

QObject.logger


name​

Get Signature​

get name(): string

Defined in: core/src/QObject.ts:8

Returns​

string

Inherited from​

QObject.name


parameters​

Get Signature​

get parameters(): TParameters

Defined in: pdf/src/QPdfTemplate.ts:40

Parameters forwarded to the template.

Returns​

TParameters

Set Signature​

set parameters(parameters): void

Defined in: pdf/src/QPdfTemplate.ts:47

Set parameters for the template.

Parameters​
parameters​

TParameters

Returns​

void


templateName​

Get Signature​

get templateName(): string

Defined in: pdf/src/QPdfTemplate.ts:28

Name of the template that will be rendered.

Returns​

string

Set Signature​

set templateName(value): void

Defined in: pdf/src/QPdfTemplate.ts:32

Parameters​
value​

string

Returns​

void

Methods​

endSpan()​

protected endSpan(span): void

Defined in: core/src/QObject.ts:35

End a span returned by startSpan.

Parameters​

span​

TelemetrySpan

The span to end.

Returns​

void

Inherited from​

QObject.endSpan


recordSpanError()​

protected recordSpanError(span, err): void

Defined in: core/src/QObject.ts:45

Record an exception on an active span.

Parameters​

span​

TelemetrySpan

The span to record the error on.

err​

unknown

The error to record.

Returns​

void

Inherited from​

QObject.recordSpanError


render()​

render(): ObjectLiteral

Defined in: pdf/src/QPdfTemplate.ts:54

Render the template into a pdfmake document definition.

Returns​

ObjectLiteral


setSpanAttribute()​

protected setSpanAttribute(span, key, value): void

Defined in: core/src/QObject.ts:64

Set a single attribute on an active span.

Parameters​

span​

TelemetrySpan

The span to update.

key​

string

Attribute key.

value​

string | number | boolean

Attribute value.

Returns​

void

Inherited from​

QObject.setSpanAttribute


startSpan()​

protected startSpan(spanName, options?): TelemetrySpan

Defined in: core/src/QObject.ts:26

Start a telemetry span for the given operation name. Returns undefined when no telemetry provider is active.

Parameters​

spanName​

string

Name of the span.

options?​

TelemetrySpanOptions

Optional span attributes and kind.

Returns​

TelemetrySpan

Inherited from​

QObject.startSpan