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

Indian Currency ₹ is not printed its printed 1 #3806

Open
manoharaher opened this issue Dec 28, 2024 · 4 comments
Open

Indian Currency ₹ is not printed its printed 1 #3806

manoharaher opened this issue Dec 28, 2024 · 4 comments

Comments

@manoharaher
Copy link

Not able to print Indian currency ₹

@bhargav-tibadiya
Copy link

Hey @manoharaher

Not all of the fonts support the Indian ₹ symbol. Make sure to download the font that does and embed it in a jsPDF and then use it. I think Roboto and Noto Sans support it. Give them a try once.

Do let me know if the issue isn't resolved. I will be happy to help.

@Tarunvamsi
Copy link

Hey @bhargav-tibadiya,

I tried using the Roboto font but couldn't get it to work. Here are the steps I followed:

Downloaded the .ttf file for the font.

Converted it to a base64-encoded .js file.

Imported it as:

import RobotoFont from "./fonts/Roboto-Regular.js"; doc.addFileToVFS("Roboto-Regular.ttf", RobotoFont); doc.addFont("Roboto-Regular.ttf", "Roboto", "normal"); doc.setFont("Roboto");

However, the font is not applying correctly in the generated PDF. Could you please help if I’m missing something?

@bhargav-tibadiya
Copy link

Hello @Tarunvamsi,

Please follow the instructions below to resolve your issue:


  1. Try using doc.setFont("Roboto", "normal").
  2. To convert your font to Base64, use the following link: Font Converter.
    • Upload your font, select the font name, and download the generated JS file.
    • Copy the Base64 string and paste it into your code.
  3. Ensure that the Base64 string is exported as the default.

If the issue persists, please let me know.


@Tarunvamsi
Copy link

Hey @bhargav-tibadiya ,

Thank you for your help! It worked perfectly.🙌

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

3 participants