How to use the pdfmake/build/pdfmake.min.fonts function in pdfmake

To help you get started, we’ve selected a few pdfmake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mrin9 / RapiPdf / src / pdf-gen.js View on Github external
const finalDocDef = {
    footer(currentPage, pageCount) {
      return {
        margin: 10,
        columns: [
          { text: options.pdfFooterText, style: ['sub', 'gray', 'left'] },
          { text: `${currentPage} of ${pageCount}`, style: ['sub', 'gray', 'right'] },
        ],
      };
    },
    content: allContent,
    styles: pdfStyles,
  };


  pdfMake.fonts = {
    Roboto: {
      normal: 'Roboto-Regular.ttf',
      bold: 'Roboto-Medium.ttf',
      italics: 'Roboto-Italic.ttf',
      bolditalics: 'Roboto-Medium.ttf',
    },
    RobotoMono: {
      normal: 'RobotoMono-Regular.ttf',
      bold: 'RobotoMono-Regular.ttf',
      italics: 'RobotoMono-Regular.ttf',
      bolditalics: 'RobotoMono-Regular.ttf',
    },

  };
  // pdfMake.vfs = pdfFonts.pdfMake.vfs;
  pdfMake.vfs = pdfFonts;