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

Unit Test not running successfully #55

Open soitgoes opened 7 years ago

soitgoes commented 7 years ago

On Mac Osx node version 7.5.0 and 5.12.0 PDFtk version 2.0.2 on master branch

pdfFiller Tests fillForm() 1) should not throw an error when creating test_complete.pdf from test.pdf with filled data 2) should create an completely filled PDF that is read-only 3) should create an completely filled PDF that is read-only and with an specific temporary folder for FDF files 4) should create an unflattened PDF with unfilled fields remaining generateFieldJson() 5) should generate form field JSON as expected 6) should generate another form field JSON with no errors generateFDFTemplate() 7) should generate a FDF Template as expected 8) should generate another FDF Template with no errors convFieldJson2FDF() ✓ Should generate an corresponding FDF object mapForm2PDF() ✓ Should convert formJson to FDF data as expected

2 passing (2m) 8 failing

1) pdfFiller Tests fillForm() should not throw an error when creating test_complete.pdf from test.pdf with filled data: Error: timeout of 15000ms exceeded. Ensure the done() callback is being called in this test.

2) pdfFiller Tests fillForm() should create an completely filled PDF that is read-only: Error: timeout of 15000ms exceeded. Ensure the done() callback is being called in this test.

3) pdfFiller Tests fillForm() should create an completely filled PDF that is read-only and with an specific temporary folder for FDF files: Error: timeout of 15000ms exceeded. Ensure the done() callback is being called in this test.

4) pdfFiller Tests fillForm() should create an unflattened PDF with unfilled fields remaining: Error: timeout of 15000ms exceeded. Ensure the done() callback is being called in this test.

5) pdfFiller Tests generateFieldJson() should generate form field JSON as expected: Error: timeout of 15000ms exceeded. Ensure the done() callback is being called in this test.

6) pdfFiller Tests generateFieldJson() should generate another form field JSON with no errors: Error: timeout of 15000ms exceeded. Ensure the done() callback is being called in this test.

7) pdfFiller Tests generateFDFTemplate() should generate a FDF Template as expected: Error: timeout of 15000ms exceeded. Ensure the done() callback is being called in this test.

8) pdfFiller Tests generateFDFTemplate() should generate another FDF Template with no errors: Error: timeout of 15000ms exceeded. Ensure the done() callback is being called in this test.

npm ERR! Test failed. See above for more details.

jasonphillips commented 7 years ago

On recent versions of OSX, pdftk may hang indefinitely. I ended up having to set up a Docker container (with node + pdftk) in order to begin developing on this at all.

You might try to invoke the form_fill method of pdftk directly on the command line and see if it stalls.

jasonphillips commented 7 years ago

So I just found out that the company behind pdftk released an alternate build for OSX 10.11-10.12, but still have not updated the main download links on their site. You can access the corrected build here:

https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg

maximilianschmidt commented 7 years ago

seems to be similar to the bug mentioned in issue #51

senica commented 7 years ago

This does not seem to be related to pdffiller itself, but rather pdftk. I had a similar setup as @soitgoes and then ran into the issue referenced by @maximilianschmidt . That solved the problem for me with no changes to pdffiller