Skip to content

SudoSOS Back-end API / internal/pdf / PdfService

Abstract Class: PdfService<T, P> ​

Turns an entity into HTML and PDF bytes. One subclass per document type.

Extends ​

Extended by ​

Type Parameters ​

Type Parameter
T
P extends PdfTemplateParameters

Constructors ​

Constructor ​

ts
new PdfService<T, P>(manager?): PdfService<T, P>;

Parameters ​

ParameterType
manager?EntityManager

Returns ​

PdfService<T, P>

Inherited from ​

WithManager.constructor

Properties ​

PropertyModifierTypeInherited from
managerprotectedEntityManagerWithManager.manager

Methods ​

compile() ​

ts
protected compile(params): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
paramsP

Returns ​

Promise<Buffer<ArrayBufferLike>>


configureLogger() ​

ts
protected configureLogger(logger): void;

Parameters ​

ParameterType
loggerLogger

Returns ​

void

Inherited from ​

WithManager.configureLogger


getParameters() ​

ts
abstract getParameters(entity): Promise<P>;

Parameters ​

ParameterType
entityT

Returns ​

Promise<P>


html() ​

ts
html(entity): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityT

Returns ​

Promise<Buffer<ArrayBufferLike>>


output() ​

ts
output(entity, fileType): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityT
fileTypeReturnFileType

Returns ​

Promise<Buffer<ArrayBufferLike>>


pdf() ​

ts
pdf(entity): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityT

Returns ​

Promise<Buffer<ArrayBufferLike>>


render() ​

ts
abstract render(params): string;

Parameters ​

ParameterType
paramsP

Returns ​

string