Skip to content

SudoSOS Back-end API / internal/pdf/transfer-pdf-service / TransferPdfService

Class: TransferPdfService ​

HTML-to-PDF service for entities that don't store PDFs. It inherits createPdfBuffer and createRaw from BaseHtmlPdfService. It does not implement any stored interface.

Extends ​

Constructors ​

Constructor ​

ts
new TransferPdfService(manager?): TransferPdfService;

Parameters ​

ParameterType
manager?EntityManager

Returns ​

TransferPdfService

Inherited from ​

HtmlUnstoredPdfService.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionOverridesInherited from
clientprotectedClientundefined--HtmlUnstoredPdfService.client
htmlGeneratorpublic(options) => stringcreateTransferPdfThe function that generates the HTML. This function should take a data object and return the complete HTML string.HtmlUnstoredPdfService.htmlGenerator-
htmlPdfGenUrlprotectedstringundefined--HtmlUnstoredPdfService.htmlPdfGenUrl
managerprotectedEntityManagerundefined--HtmlUnstoredPdfService.manager

Methods ​

compileHtml() ​

ts
protected compileHtml(html): Promise<Buffer<ArrayBufferLike>>;

Compile HTML to PDF using the external service.

Parameters ​

ParameterType
htmlstring

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

HtmlUnstoredPdfService.compileHtml


createPdfBuffer() ​

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

Create a PDF and return bytes.

Parameters ​

ParameterType
entityTransfer

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

HtmlUnstoredPdfService.createPdfBuffer


createRaw() ​

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

Create raw HTML output (for debugging or preview).

Parameters ​

ParameterType
entityTransfer

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

HtmlUnstoredPdfService.createRaw


getHtml() ​

ts
protected getHtml(entity): Promise<string>;

Apply parameters to the template and return the complete HTML.

Parameters ​

ParameterType
entityTransfer

Returns ​

Promise<string>

Inherited from ​

HtmlUnstoredPdfService.getHtml


getParameters() ​

ts
getParameters(entity): Promise<ITransferPdf>;

Get the data object to use with the HTML template.

Parameters ​

ParameterType
entityTransfer

Returns ​

Promise<ITransferPdf>

Overrides ​

HtmlUnstoredPdfService.getParameters