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 dropXFA option for fillForm. Refactoring fillForm options. #57

Open SciencePiggy opened 7 years ago

johntayl commented 7 years ago

Adding options args seems to be the wanted approach for a while. fillFormWithFlatten() would be redundant if fillFormWithOptions() arguments are going to be modified to support the options arg.

Looking at the pdftk args, this could also be a property within options, instead of written checks for specific edge cases (ie. drop_xfa).

_defaultOptions = {
    args: [], // [ 'flatten', 'drop_xfa', ... ]
    tempFDFPath: undefined
}
SciencePiggy commented 7 years ago

Truth be told I wasn't paying close enough attention when I opened my PR. That said ...

I agree RE: fillFormWithFlatten() but I didn't want to rock the boat in terms of deprecating code, which I failed to do with fillFormWithOptions(). Current commit is a half measure but may be the safer approach?