Creating Arabic Content with PDFKit & nodeJS

I am using pdfkit with nodejs to generate dynamically PDFs. the generation works fine, but I have a problem displaying Arabic characters even if I set up a font that supports Arabic.

The letters are displayed correctly, but the words are displayed character by character :(

here is my code

doc = new PDFDocument;
doc.pipe(fs.createWriteStream('output.pdf'));
var str = "فصل الربيع الزهور \n#nature #payesage #fleurs #plantes #vert #espace #temara #rabat #maroc #WeekEnd #balade #instamoment #instalife #instamaroc #photographie #macro #peace";
doc.font('resources/HelveticaNeueLTArabic-Roman.ttf').text(str);

      

Any thoughts or suggestions would be great.

+3
node.js pdfkit


source to share


No one has answered this question yet

Check out similar questions:

1544
How can I upgrade NodeJS and NPM to the next versions?
485
Is there a way to get the version from package.json in nodejs code?
430
How to fix the error: Listen to EADDRINUSE when using nodejs?
296
nodejs vs node on ubuntu 12.04
4
Howto: output euro symbol in pdfkit for nodejs
3
Using pdfkit in node.js to render text in any language
1
How to click to go to pdfkit page for nodejs?
0
Using PDFKIT to generate PDF with nodejs
0
Nodejs pdfkit cell width error
0
Nodejs and pdfKit and qr-image



All Articles
Loading...
X
Show
Funny
Dev
Pics