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

Using tmp module to create fdf files #18

Closed harigopalakrishna closed 8 years ago

harigopalakrishna commented 8 years ago

Hey - I was filling multiple PDFs asynchronously (ran in to a conflict with .fdf file names) and realized that the below way of creating temp .fdf is not scaling for my needs.

tempFDF = "data" + (new Date().getTime()) + ".fdf";

I changed the line to use 'tmp' module, and make necessary changes in package.json

tempFDF= tmpFileobj.name+'.'+new Date().getTime() +".fdf";

Thanks, Hari

harigopalakrishna commented 8 years ago

A quick note : I noticed that pull request has too many whitespace changes, which i did not intend to make

whitef0x0 commented 8 years ago

I would rather not use another module when this could be just as easily accomplished with rand().

harigopalakrishna commented 8 years ago

Sounds good. Thanks for the feedback. The goal is not to produce conflicting filenames when mass producing these temp files. rand() did not cut it for me.