i am using pdfkit for convert for create PDF file and it's work fine with this code.
var fs = require('fs');
var PDFDocument = require('pdfkit');
pdf.text('{{ }} text ');
pdf.pipe(
fs.createWriteStream('./data/file1.pdf')
)
.on('finish', function () {
console.log('PDF closed');
});
// Close PDF and write file.
pdf.end();
this code are work pretty but i want to convert chines text and some special character too with a-z text for example i want to make pdf of
pdf.text('{{ }} text 漢字 昨夜のコンサートは最高でした');
this is not give me proper output .
Unfortunately PDFKit doesn't seem to support converting documents to PDF:
The documentation states nothing about converting. This module seems to be purely for creating the documents from scratch.
You'll have to find a module or create something that takes an MS Doc and converts it to text, store this in your node app, then pass it through to PDFKit via the methods shown in the documentation.
Mammoth seems to do this.
There's a bunch of docx modules that might do an even better job.
Hope this helps!