dommmel / fill-pdf

A node module to fill out pdf forms (utf8 compatible).
MIT License
55 stars 32 forks source link

Filling Asian charicters #48

Open SpringsTea opened 4 years ago

SpringsTea commented 4 years ago

I'm doing some form filling and have to accommodate Japanese text. This does not seem to be supported with the default options.

let FillData = {
    text: 'ベルゼルグ王国第一王女 アイリス'
}

fillPdf.generatePdf(FillData, Form.path, function(err, output) {
      if ( !err ) {
          res.type("application/pdf");
          res.send(output);
      }
});

This will output a pdf with my text field filled with: ã…Žã…«ã‡¼ã…«ã‡°ç”‰åł½ç¬¬ä¸•ç”‰å¥³ ㇢㇤ㅪㇹ

How do I configure this to allow the correct encoding?

librorum commented 4 years ago

I have the same issue..

may be the problem comes from the function

escapeFdf(data)

Mousaka commented 4 years ago

Having the same problem with Swedish characters "åäöÅÄÖ". Tried adding the extra argument need_appearances but that did not help https://www.pdflabs.com/docs/pdftk-man-page/#dest-output-need-appearances =(

ysarzhynskyi commented 4 years ago

I'm also having this issue when trying to use it like this fillPdf.generatePdf(data, filePath, ['need_appearances'], (err, output) => (err ? reject(err) : resolve(output)))

michaeldoubek commented 3 years ago

Same for Czech characters too.