Looking for a clean way to remove the initial page in a Reader-enabled dynamic PDF (level 3 protecti
Thanks in advance to anyone who can help.
I have a PDF form that’s distributed to users via Acrobat Reader, with level 3 (Reader Extended) protection — please keep that in mind for any suggested solutions.
The form works correctly, and even includes a working SaveAs solution via script, thanks to the helpful advice from @try67.
Now I’m trying to improve the last remaining piece.
The form includes 4 hidden templates, which are spawned via scripts based on user selections in certain fields. However, after the pages are generated, I need to remove the initial page, which was used only to collect those user inputs.
Since the first (and only) page of a PDF cannot be deleted (only spawned pages can be removed), I couldn’t start with a fully blank file. So I came up with a workaround: I start with a very small page (1cm x 1cm), which contains a warning telling the user to open the file in Acrobat Reader and click a button to begin.
Once the user clicks, the appropriate templates are spawned, the logic works fine, and the form behaves as expected.
However, the issue is that the tiny initial page still remains in the document — even after being visually “whited out” with a full-size white button over it — and I don't like that.
I wanted to test an approach using layers (OCG), skipping the tiny first page altogether. My idea was to start directly with the first real template (the input page) as the initial page, then add a completely white overlay layer, and finally spawn the next template using spawn() with overlay = true, placing it visually above the white mask.
But from my tests, it seems that a white graphic overlay only hides the page’s background graphics — not the form fields, which always stay visible regardless of layer behavior.
Has anyone ever tried to tackle a similar problem, or found a clean way to “replace” or hide the first page in a Reader-enabled PDF using layers or any other creative method?
