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

How to check file is correct format #66

Open jay-meister opened 6 years ago

jay-meister commented 6 years ago

Thanks for producing this package, it's served me very well so far 👍

I've done some googling but not found anything of use.

I want to know if there is any way to check if a form is of the correct type for this package to be used to merge data into a fillable pdf? As user's are uploading their own PDFs, I want to prevent anything but Acroforms being uploaded, does anyone know of a way we could do that?

I want to prevent this error from occurring:

 "exec error: Error: Command failed: pdftk //app/tmp/non-acro-form.pdf fill_form temp_data1518625540765ubuis738okegnl2138fr.fdf output //app/tmp/non-acro-form-merged.pdf

Warning: input PDF is not an acroform, so its fields were not filled."
-------

Any suggestions would be much appreciated!