h1dd3nsn1p3r / pdf-invoice

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

:fire: Added: Font and style option in config. #26

Closed h1dd3nsn1p3r closed 3 months ago

h1dd3nsn1p3r commented 3 months ago

:fire: 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"),
        },
    },
};