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

Adding path for temporary FDF files #41

Closed anperez78 closed 7 years ago

anperez78 commented 7 years ago

Main idea is to enable the configuration of the path for the temporary FDF files that are created when filling a form.

At the moment files are created on the current working directory, which is not always a suitable location and can cause problems. Specially when you run your NodeJS application using process managers such as pm2, forever, etc.

whitef0x0 commented 7 years ago

@anperez is this an issue because of file permissions?

anperez78 commented 7 years ago

Exactly! file permissions issue :)

whitef0x0 commented 7 years ago

@johntayl

johntayl commented 7 years ago

For those who've been using the fillFormWithFlatten method directly to override shouldFlatten they will be required to add an additional parameter otherwise the callback will be undefined.

Maybe wrapping this custom path functionality into another method like fillForm?

But this also brings up the question of multiple methods for specific options.

Considering a rethink of this method so an options parameter can be provided with defaulted values for shouldFlatten and tempFDFPath and any other values that may be needed.

Thoughts?

anperez78 commented 7 years ago

At the moment, and not to break the previous use of fillFormWithFlatten, I've just added a new method fillFormWithOptions to include all options (temp path + shouldFlatten).