pdffillerjs / pdffiller

Take an existing PDF Form and data and PDF Filler will create a new PDF with all given fields populated.
MIT License
286 stars 113 forks source link

Unhandled Java Exception in create_output(): #62

Open DamickDoni opened 6 years ago

DamickDoni commented 6 years ago

I just want to test pdffiler, if my task can be done by this module. BUt after installing pdftk and code the example into my project, I get this error:

> exec error: Error: Command failed: pdftk xxx.pdf fill_form temp_data1508163976446ybvrr.fdf output test_complete.pdf flatten
Unhandled Java Exception in create_output():
java.io.CharConversionException
   at 0x0059a84e (Unknown Source)
   at 0x0059ad42 (Unknown Source)
   at 0x0059adf3 (Unknown Source)
   at 0x005e9bed (Unknown Source)
   at 0x00590c8d (Unknown Source)
   at 0x006ccc5d (Unknown Source)
   at 0x0069eb80 (Unknown Source)
   at 0x005958f6 (Unknown Source)
   at 0x00599492 (Unknown Source)
   at 0x005994cc (Unknown Source)
   at 0x004ba290 (Unknown Source)
   at 0x0046ee85 (Unknown Source)
   at 0x0046e7a0 (Unknown Source)
   at 0x0046deff (Unknown Source)
   at 0x00430bfa (Unknown Source)
   at 0x0043496f (Unknown Source)
   at 0x004344c7 (Unknown Source)

C:\Users\XXX\node_projects\xxx.js:428
        if (err) throw err;
                 ^

Error: Command failed: pdftk xxx.pdf fill_form temp_data1508163976446ybvrr.fdf output test_complete.pdf flatten
Unhandled Java Exception in create_output():
java.io.CharConversionException
   at 0x0059a84e (Unknown Source)
   at 0x0059ad42 (Unknown Source)
   at 0x0059adf3 (Unknown Source)
   at 0x005e9bed (Unknown Source)
   at 0x00590c8d (Unknown Source)
   at 0x006ccc5d (Unknown Source)
   at 0x0069eb80 (Unknown Source)
   at 0x005958f6 (Unknown Source)
   at 0x00599492 (Unknown Source)
   at 0x005994cc (Unknown Source)
   at 0x004ba290 (Unknown Source)
   at 0x0046ee85 (Unknown Source)
   at 0x0046e7a0 (Unknown Source)
   at 0x0046deff (Unknown Source)
   at 0x00430bfa (Unknown Source)
   at 0x0043496f (Unknown Source)
   at 0x004344c7 (Unknown Source)

    at ChildProcess.exithandler (child_process.js:270:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:897:16)
    at Socket.stream.socket.on (internal/child_process.js:340:11)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at Pipe._handle.close [as _onclose] (net.js:549:12)

My example code looks like this: var pdfFiller = require('pdffiller'); var sourcePDF = "xxx.pdf"; var destinationPDF = "destination.pdf"; var data = { "prename": "Name written", "clientlastname": "lastname written" }; pdfFiller.fillForm( sourcePDF, destinationPDF, data, function(err) { if (err) throw err; console.log("In callback (we're done)."); });

What should I change?

omarcarreon commented 5 years ago

Hi, did you found the solution? I have the same issue

vpeter1119 commented 2 years ago

I'm having the same problem, couldn't find a solution

rgb-git commented 1 year ago

Change the font of the fields to either Helvetica, Times Roman or Courier, pdftk will successfully create a PDF. https://stackoverflow.com/questions/23948647/font-issue-with-pdftk