h1dd3nsn1p3r / pdf-invoice

🥳 A node JS library that generates PDF invoice, estimates & receipts.
https://www.npmjs.com/package/@h1dd3nsn1p3r/pdf-invoice
MIT License
4 stars 6 forks source link

🔥 Added: Font and style option in config. #27

Closed h1dd3nsn1p3r closed 4 months ago

h1dd3nsn1p3r commented 4 months ago

🔥 Added: Font and style option in config.

/* --------------------------------------------------------------------------
    Optional: Config
  -------------------------------------------------------------------------- */
const config = {
    string: {
        invoice: "F A C T U A",
        refNumber: "Referencia",
        date: "Fecha",
        dueDate: "Fecha de vencimiento",
        status: "επί πληρωμή",
        billTo: "Facturar a",
        item: "Artículo",
        quantity: "Cantidad",
        price: "Precio",
        tax: "Impuesto",
        total: "Total",
        subTotal: "Subtotal",
        totalTax: "Total Impuesto",
    },
    style: {
        font: "Noto", // "Helvetica", "Times", "Courier"
        fontSize: 10,
        lineHeight: 1.2,
        color: "#000000",
    },
    font: {
        Noto: {
            normal: path.join(__dirname, "fonts/noto/regular.ttf"),
            italics: path.join(__dirname, "fonts/noto/italic.ttf"),
            bold: path.join(__dirname, "fonts/noto/bold.ttf"),
            bolditalics: path.join(__dirname, "fonts/noto/bold-italic.ttf"),
        },
    },
};