Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with ₹ symbol. #36

Open
karanvishesh opened this issue Nov 24, 2024 · 2 comments
Open

Issue with ₹ symbol. #36

karanvishesh opened this issue Nov 24, 2024 · 2 comments

Comments

@karanvishesh
Copy link

When I try to pass "₹" as currency in the invoice object I get '1' in the pdf. Can you guys please add support for rupee symbol as well.

@h1dd3nsn1p3r
Copy link
Owner

h1dd3nsn1p3r commented Nov 25, 2024

Hi @karanvishesh

I just tried it is working for me.

image

Generated invoice:

image

I copied the symbol from here.

@karanvishesh
Copy link
Author

karanvishesh commented Nov 28, 2024

Hello @h1dd3nsn1p3r, I copied the symbol from the above given link still getting the same output.
invoice.pdf

Code :


const payload = {
    company: {
        name: "Lights",
        address: "Electronics Market",
        phone: "38439822828",
        email: "Mail: [email protected]",
        website: "Web: https://www.Lights.com"
    },
    customer: {
        name: "John"
    },
    invoice: {
        number: 1721, // String or number.
        date: "24/11/2024",
        currency: "₹", // Default is "$",
        Status: "Paid",
        path: "./invoice.pdf", // Required. Path where you would like to generate the PDF file. 
    },
    items: [
        {
            name: "100 bulbs",
            quantity: 50,
            price: 200
        },
    ],
    // qr: {
    //     data: "https://www.festrolcorp.io",
    //     width: 100,
    // },
    note: {
        text: "Thank you for your business.",
        italic: false
    }
};

const handleInvoice = async() => {
    /**
    * Create the invoice.
    */
    const invoice = new PDFInvoice(payload);
    const pdf = await invoice.create(); // Returns promise, await it.

    console.log(pdf); // Full path to the PDF file.
}

handleInvoice();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants