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

Devanagari Font not rendering properly #174

Open
varadeth opened this issue Apr 18, 2023 · 0 comments
Open

Devanagari Font not rendering properly #174

varadeth opened this issue Apr 18, 2023 · 0 comments

Comments

@varadeth
Copy link

I am trying to convert svg with devanagari fonts and it is not rendering the way it was supposed to.

Following is the code that I am trying to use

const svg = fs.readFileSync('random.svg').toString();
const doc = new PDFDocument();
const fontData = fs.readFileSync('./NotoSansDevanagari/NotoSansDevanagari-Regular.ttf');
doc.registerFont('NotoSansDevanagari', fontData);
SVGToPDF(doc, svg, 0, 0, {fontCallback: () => {
      return 'NotoSansDevanagari';
    }})
doc.pipe(res)
doc.end()

Below is the svg file I am trying to convert
certificate4
and it is getting converted to
response.pdf

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

1 participant