@nestjsforge/pdfme
Configuration (forRoot)
Synchronous configuration for PdfmeModule using forRoot.
Use PdfmeModule.forRoot(options) to configure the module synchronously:
PdfmeModule.forRoot({
fonts: {
NotoSans: {
data: readFileSync('./fonts/NotoSans-Regular.ttf'),
fallback: true, // Use as fallback when no font is specified
},
NotoSansBold: {
data: readFileSync('./fonts/NotoSans-Bold.ttf'),
fallback: false,
},
},
plugins: {
qrcode: qrCodePlugin, // Custom or third-party plugin
},
})Configuration Reference
| Option | Type | Required | Description |
|---|---|---|---|
| fonts | Record | No | Named font definitions to register globally |
| plugins | Record | No | Custom schema plugins to register globally |