I'd like to activate some text objects only on the final invoice page. (One invoice data page generates 1 to n printed invoice pages.)
So, I've created a global condition called &isLastPage, which I'm setting to true or false inside my Runpage's Talk logic, as shown here:
%
% Print out each Invoice page, respecting the number of items
% that can fit on a page.
%
&isLastPage := false
&giFirstItemOnPage := 1
for(&giCurPage, 1, 1, &giNumPages)
% Identify the last item on the present page.
if( &giCurPage = &giNumPages )
% We're printing the final page.
&isLastPage := true
&giLastItemOnPage := &iNumItems
elseif
% We're not printing the final page.
&giLastItemOnPage := &giLastItemOnPage + &iMaxItemsOnPage
endif
% Print the current page, showing the two most recent tracking #'s.
execpage('OverlayInvoicePage')
showpage
% Setup the first item on the next page.
&giFirstItemOnPage := &giFirstItemOnPage + &iMaxItemsOnPage
endfor
The problem I'm seeing occurs when I attempt to Print Preview the document. During the "Converting PostScript to PDF" phase of the Preview Processing, the error message "Error converting file: rangecheck" appears, causing the Preview to abort.
I've narrowed the issue down to the "&isLastPage := true" statement inside my Talk for loop above. This is the statement which identifies the final invoice page and sets the global variable to true.
Any ideas what might be going on here, or maybe you have a different solution for handling the "last page" condition?
Thanks again for any help,
Juan