pdffillerjs / pdffiller

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

Multiple calls fdf.data conflict #2

Closed dhautot closed 8 years ago

dhautot commented 9 years ago

Hi !

Great tool ! thanks!

When looping to generate several PDFs, a conflict seems to appear with the tempFDF = "data.fdf".

I solved this issue by changing the FDF name file in the index.js file :

var formData = fdf.generate( fieldValues ), tempFDF = "data" + (new Date().getTime()) + ".fdf";

This ensure that the tempFDF file will be unique at any time.

harigopalakrishna commented 9 years ago

I just created a pull request 18, to address this situation for high traffic pdf filling needs

whitef0x0 commented 8 years ago

@harigopalakrishna This is already fixed if you look at the current source code. See line 113 of index.js