New Forum | Previous | Next | (P-PDF) Developers
Topic: Populating multiple PDFs with FDF
Conf: (P-PDF) Developers, Msg: 55803
Date: 5/29/2002 05:15 PM
Using Acrobat Reader 4.05 as a Print Preview/Print service only on a Client/Server application, our client requires to print the same form numerous times, each populated with different data (ie: data.pdf includes name/addresses of specific customer. They want information of 3 customers printed on the fly at one time). In Acrobat 4.05, I have set ReadOnly controls on the PDF form that the client has provided as well as an import file, set in SetData, for an FDF file. In Delphi code, an FDF file has been created (info.fdf) and a FileOpen DDE call is made. This correctly brings up the PDF populated with the data set in info.fdf.
The problem is trying to load numerous PDF forms with multiple versions of the same info.fdf file. What I do is CopyFile and DDE FileOpen data1.pdf, data2.pdf, etc., all which are copies of data.pdf. In between each FileOpen, I recreate an info.fdf, each with different customer information. The expectation is that when I DDE FileOpen data1.pdf, it will be populated with the first info.fdf created, then DDE FileOpen data2.pdf, it will be populated with the second info.fdf created, and so on. Unfortately, this does not happen. By the time the first data1.pdf form appears in Acrobat Reader, the second fdf file has already been created in the code resulting in both data1.pdf and data2.pdf getting the same data, which is the data of the final info.fdf created.
To get the proper data populated in the forms, I have to do a 2 second API Sleep call in between the creations of the fdf files. This works fine on my machine but probably not so on all machines. Is there a way of determining when Acrobat Reader grabs an FDF file to populate the fields? Because if I know this, I can then determine when to produce the subsequent FDF files.