Page spawned from template not rendering
Hello,
Brand new at PDF scripting and running into an issue trying to spawn pages from template. My use case is an "Add Item" button that adds an identical form page with some fields reset. The easiest way seems like:
this.getField("Add Item").display=display.hidden;
this.templates[0].spawn({
nPage: pageNum,
bRename: true,
bOverlay: false
});
this.getField("Add Item").display=display.noPrint;
this.resetForm([
<subset of fields to reset>
])
Setting nPage to pageNum displaces the original page to the end where only it should have the Add Item button, not the spawned template pages since the fields are named differently (was not able to use wildcard).
Functionally it works. The problem comes from the display.noPrint row. Adding the button back wrecks the the original template page, but it seems to be a UI issue. Zooming/scrolling/etc restores all form fields in both Acrobat and Reader.
Any ideas what is wrong here and how to fix, or a better way altogether?
