@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

OptionTypeRequiredDescription
fontsRecordNoNamed font definitions to register globally
pluginsRecordNoCustom schema plugins to register globally