SudoSOS Back-end API / internal/pdf / HtmlUnstoredPdfService
Abstract Class: HtmlUnstoredPdfService<T, P> ​
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 ​
BaseHtmlPdfService<T,P>
Extended by ​
Type Parameters ​
| Type Parameter | Default type |
|---|---|
T extends IUnstoredPdfAble | - |
P extends PdfTemplateParameters | PdfTemplateParameters |
Constructors ​
Constructor ​
ts
new HtmlUnstoredPdfService<T, P>(manager?): HtmlUnstoredPdfService<T, P>;Parameters ​
| Parameter | Type |
|---|---|
manager? | EntityManager |
Returns ​
HtmlUnstoredPdfService<T, P>
Inherited from ​
BaseHtmlPdfService.constructor
Properties ​
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
client | protected | Client | - | BaseHtmlPdfService.client |
htmlGenerator | abstract | HtmlGenerator<P> | The function that generates the HTML. This function should take a data object and return the complete HTML string. | BaseHtmlPdfService.htmlGenerator |
htmlPdfGenUrl | protected | string | - | BaseHtmlPdfService.htmlPdfGenUrl |
manager | protected | EntityManager | - | BaseHtmlPdfService.manager |
Methods ​
compileHtml() ​
ts
protected compileHtml(html): Promise<Buffer<ArrayBufferLike>>;Compile HTML to PDF using the external service.
Parameters ​
| Parameter | Type |
|---|---|
html | string |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
BaseHtmlPdfService.compileHtml
createPdfBuffer() ​
ts
createPdfBuffer(entity): Promise<Buffer<ArrayBufferLike>>;Create a PDF and return bytes.
Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
BaseHtmlPdfService.createPdfBuffer
createRaw() ​
ts
createRaw(entity): Promise<Buffer<ArrayBufferLike>>;Create raw HTML output (for debugging or preview).
Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
getHtml() ​
ts
protected getHtml(entity): Promise<string>;Apply parameters to the template and return the complete HTML.
Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<string>
Inherited from ​
getParameters() ​
ts
abstract getParameters(entity): Promise<P>;Get the data object to use with the HTML template.
Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<P>