SudoSOS Back-end API / internal/pdf / PdfService
Abstract Class: PdfService<S, T, R> ​
Stored PDF service. Uses BasePdfService to produce bytes then uploads and returns the Pdf entity.
Extends ​
BasePdfService<T,R>
Extended by ​
Type Parameters ​
| Type Parameter |
|---|
S extends Pdf |
T extends IPdfAble<S> |
R extends RouteParams |
Implements ​
IStoredPdfService<T,S>
Constructors ​
Constructor ​
ts
new PdfService<S, T, R>(fileLocation, manager?): PdfService<S, T, R>;Parameters ​
| Parameter | Type |
|---|---|
fileLocation | string |
manager? | EntityManager |
Returns ​
PdfService<S, T, R>
Overrides ​
Properties ​
| Property | Modifier | Type | Default value | Inherited from |
|---|---|---|---|---|
client | public | Client | undefined | BasePdfService.client |
fileService | public | FileService | undefined | - |
manager | protected | EntityManager | undefined | BasePdfService.manager |
pdfConstructor | abstract | () => S | undefined | - |
routeConstructor | abstract | (data) => R | undefined | BasePdfService.routeConstructor |
stationary | public | string | 'BAC' | BasePdfService.stationary |
Methods ​
createPdfBuffer() ​
ts
createPdfBuffer(entity): Promise<Buffer<ArrayBufferLike>>;Core method that generates and returns the PDF bytes.
Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
BasePdfService.createPdfBuffer
createPdfWithEntity() ​
ts
createPdfWithEntity(entity): Promise<S>;Persist the generated PDF and return the stored Pdf entity.
Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<S>
Implementation of ​
IStoredPdfService.createPdfWithEntity
createRaw() ​
ts
createRaw(entity): Promise<Buffer<ArrayBufferLike>>;Create raw output such as TEX or HTML bytes for preview or debugging.
Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
createTex() ​
ts
createTex(entity): Promise<Buffer<ArrayBufferLike>>;Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Deprecated ​
Use createRaw() instead
Inherited from ​
generator() ​
ts
abstract generator(routeParams): Promise<FileResponse>;Parameters ​
| Parameter | Type |
|---|---|
routeParams | R |
Returns ​
Promise<FileResponse>
Inherited from ​
getFileSettings() ​
ts
protected getFileSettings(fileType?): FileSettings;Parameters ​
| Parameter | Type | Default value |
|---|---|---|
fileType | ReturnFileType | ReturnFileType.PDF |
Returns ​
FileSettings
Inherited from ​
BasePdfService.getFileSettings
getParameters() ​
ts
abstract getParameters(entity): Promise<any>;Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<any>
Inherited from ​
getRouteParams() ​
ts
getRouteParams(entity, fileType?): Promise<R>;Parameters ​
| Parameter | Type | Default value |
|---|---|---|
entity | T | undefined |
fileType | ReturnFileType | ReturnFileType.PDF |
Returns ​
Promise<R>
Inherited from ​
getClient() ​
ts
static getClient(url): Client;Parameters ​
| Parameter | Type |
|---|---|
url | string |
Returns ​
Client