|Impressario for Director||All||PDF Forms|
The GetPageText() sprite method retrieves the text of the current page of an Impressario sprite, with the data in any fields appended to the end of the fixed PDF text.
However, after an initial call to GetPageText () on a given page, if you modify a text field on that page, the modification will not appear in subsequent calls to GetPageText(). This problem occurs because the text of the page is cached on the first call to GetPageText().
The workaround is to "flush" the cache, by calling the GetPageText() member method on a different page of the document, before calling it on the page you are really interested in. Your PDF form document must have more than one page in order to use this workaround solution.
-- retrieve all text of the page, including any updated form data
x = member("myPDF").GetPageText(2) -- do it for page 2, just to clear the cache
--here's the page you really want
member("myPageText").text = member("myPDF").GetPageText(1)
The Impressario methods GetFields() and GetAllFields() are preferred, if you want to retrieve just the form data. These methods return the form control names and values in a list of Lingo property lists.