How to use the pdfmake/build/pdfmake.js.createPdf 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 HL7-DaVinci / dtr / src / components / QuestionnaireForm / QuestionnaireForm.jsx View on Github external
],
            styles: {
                header: {
                    fontSize: 13,
                    bold: true
                },
                body: {
                    fontSize: 8,
                    bold: false,
                    preserveLeadingSpaces: true
                }
            }
        };

        // create the DocumentReference and generate a PDF
        const pdfDocGenerator = pdfMake.createPdf(docDefinition);
        //pdfDocGenerator.open();
        pdfDocGenerator.getBase64((b64pdf) => {
            const documentReference = {
                resourceType: "DocumentReference",
                status: "current",
                type: {
                    "coding": [
                        {
                            "system": "http://loinc.org",
                            "code": "55107-7",
                            "display": "Addendum Document"
                        }
                    ]
                },
                description: "PDF containing a QuestionnaireResponse",
                indexed: new Date().toISOString(),
github IndomaximTechID / storaji-ui / src / app / main / orders / overview / overview.component.ts View on Github external
fontSize: 18,
          bold: true
        },
        item: {
            fontSize: 15,
            bold: true
        },
        itemColumn: {
            margin: [0, 0, 0, 15]
        },
        columns: {
            columnGap: 15,
        }
      }
    };
    pdfMake.createPdf(docDefinitions).download(
      [
        this.translate.instant('module.title.order').toUpperCase(),
        '#',
        this.order.id.split('-')[0].toUpperCase()
      ].join('')
    );
  }
github IndomaximTechID / storaji-ui / src / app / main / orders / report / report.component.ts View on Github external
color: 'black'
        }
      }
    };
    await this.orders.forEach((item, i) => {
      docDefinitions.content[0].table.body.push([
        ['#', item.id.split('-')[0]].join(''),
        item.order_detail.product.name,
        item.customer.full_name,
        item.order_detail.amount,
        this.currency.set(item.order_detail.product.selling_price).format(this.utils.format),
        this.currency.set(item.order_detail.amount * item.order_detail.product.selling_price).format(this.utils.format),
        item.created_at,
      ]);
    });
    pdfMake.createPdf(docDefinitions).download('orders.pdf');
  }
github IndomaximTechID / storaji-ui / src / app / main / products / report / report.component.ts View on Github external
}
      }
    };
    await this.products.forEach((item, i) => {
      docDefinitions.content[0].table.body.push([
        i + 1,
        item.name,
        item.sku,
        item.type.name,
        item.stock,
        this.currency.set(item.cost).format(this._utils.format),
        this.currency.set(item.selling_price).format(this._utils.format),
        (item.stock > 0) ? this.translate.instant('text.in-stock') : this.translate.instant('text.sold-out')
      ]);
    });
    pdfMake.createPdf(docDefinitions).download('products.pdf');
  }
github juliandavidmr / TrelloResume / utils / report.js View on Github external
setTimeout(function () {
    pdfMake.createPdf(docDefinition).download(`${name.replace(' ', '')}-${Date.now()}.pdf`);
  }, 10);
}