pdfadobe-readerfdf

Filling out a pdf file twice with different fdf files/data


In my client app, I'm creating an fdf file and having Reader display read and process the fdf file, thus displaying the pdf (specified in the fdf) with the data in the fdf file. This is working fine.

Problem is when I need to display the same pdf twice with different data on each. Running the second fdf, which references the same pdf filename, Reader then only displays the second set of fdf data, the first file display is closed by Reader (or is simply replaced by the second).

How can I have Reader display the same pdf file twice, with different data filled in on each copy? Is there any options or commands that can be placed in the fdf file (or somewhere else) to override this replacement behavior by Reader?

At runtime, I could create a copy of the pdf file and reference each 'new' pdf file from the respective fdf file, but that is quite a very undesirable approach.


Solution

  • You'd need to save the filled version to a new file if the PDF resides on the end users drive. In that case, FDF is capable of running a JavaScript either before the data is imported, after the data is imported, or both. After your /Fields array, add the line below to cause Reader to save the filled form to a new file, leaving the original in place.

    /JavaScript <</After (app.execMenuItem('SaveAs');)>>