How to use the pdfmake/src/printer 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 wazuh / wazuh-kibana-app / server / controllers / wazuh-reporting.js View on Github external
async report(req, reply) {
    try {
      log('reporting:report', `Report started`, 'info');
      // Init
      this.printer = new PdfPrinter(this.fonts);
      this.dd.content = [];
      if (!fs.existsSync(path.join(__dirname, REPORTING_PATH))) {
        fs.mkdirSync(path.join(__dirname, REPORTING_PATH));
      }

      if (req.payload && req.payload.array) {
        const payload = (req || {}).payload || {};
        const headers = (req || {}).headers || {};
        const { name, tab, section, isAgents, browserTimezone } = payload;
        const apiId = headers.id || false;
        const pattern = headers.pattern || false;
        const from = (payload.time || {}).from || false;
        const to = (payload.time || {}).to || false;
        let kfilters = req.payload.filters;
        const isAgentConfig = tab === 'agentConfig';
        const isGroupConfig = tab === 'groupConfig';
github wazuh / wazuh-kibana-app / server / controllers / wazuh-reporting.js View on Github external
monslight: path.join(
          __dirname,
          '../../public/utils/opensans/Montserrat-Light.ttf'
        )
      }
    };

    this.vulnerabilityRequest = new VulnerabilityRequest(this.server);
    this.overviewRequest = new OverviewRequest(this.server);
    this.rootcheckRequest = new RootcheckRequest(this.server);
    this.pciRequest = new PciRequest(this.server);
    this.gdprRequest = new GdprRequest(this.server);
    this.auditRequest = new AuditRequest(this.server);
    this.syscheckRequest = new SyscheckRequest(this.server);

    this.printer = new PdfPrinter(this.fonts);

    this.dd = {
      styles: {
        h1: {
          fontSize: 22,
          monslight: true,
          color: '#1ea5c8'
        },
        h2: {
          fontSize: 18,
          monslight: true,
          color: '#1ea5c8'
        },
        h3: {
          fontSize: 16,
          monslight: true,