Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PdfGenerator

A utility class for generation of PDF files

Hierarchy

  • PdfGenerator

Index

Methods

Static generateAndSend

  • generateAndSend(documentTemplate: any, response: Response): void
  • Generate the PDF file for the given template object, and send it back to the express request.

    To decode the response use the following example

    httpClient.get('//your-url').toPromise().then(response => {
         const file = new Blob([response], { type: 'application/pdf' });
         const fileURL = URL.createObjectURL(file);
         return fileURL;
     });
    
    static

    Parameters

    • documentTemplate: any

      The document template

    • response: Response

      The express response stream where to send back the PDF once generated

    Returns void

Static Private getFonts

  • getFonts(): object
  • Return the font configuration. The base path is the root folder of the project

    Returns object

    • Roboto: object
      • bold: string
      • bolditalics: string
      • italics: string
      • normal: string

Generated using TypeDoc