Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Looking for a clean way to remove the initial page in a Reader-enabled dynamic PDF (level 3 protecti

Explorer ,
Apr 04, 2025 Apr 04, 2025

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?

TOPICS
PDF forms
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2025 Apr 04, 2025

If you create a Template for that page, spawn a copy from it, then hide the Template you would be able to delete that spawned page when needed. Also, hiding fields on a page is quite easy using a script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2025 Apr 04, 2025

Thank You @try67 it was the first action I tried but unfortunally in protect mode lev 3 You can't hide or show templates

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2025 Apr 04, 2025

What is "protect mode lev 3" ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2025 Apr 04, 2025

RiccardoPiga_0-1743781957015.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2025 Apr 04, 2025

You need to remove the security policy and only apply it when you're done working on the file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2025 Apr 04, 2025

Remove security policy via script?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2025 Apr 04, 2025

No, manually. I assume you know the password... If you don't then you can't do it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2025 Apr 04, 2025

The generation and deletion process must take place within the form itself, as distributed and used with Reader by the end user, not as a one-time action upon my request.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2025 Apr 05, 2025

You have to do the necessary set-up work on your machine, and then distribute a file that already has the code, templates, etc., to make it work as it should. To do that you must first remove the security policy.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2025 Apr 04, 2025

Now I'm trying a different approach: I hide the graphic part with a white page layer, and I hide the fields that are still visible, then I spawn with an overlay on top. It seems to work, even though the new fields inserted via spawn become hidden, even if they are visible, and I have to take them one by one, make them invisible, and then make them visible again to make them appear.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2025 Apr 04, 2025

"Since the first (and only) page of a PDF cannot be deleted (only spawned pages can be removed)"

Answer is in the question: make the first page a hidden template, spawn it, then Reader will be able to delete it.

 

"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"

That's true, unless you create the layered PDF and its fields with InDesign.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2025 Apr 04, 2025
quote

"Since the first (and only) page of a PDF cannot be deleted (only spawned pages can be removed)"

Answer is in the question: make the first page a hidden template, spawn it, then Reader will be able to delete it.

 

You can't have a PDF with only hidden tamplate. An original page (that can't be delete) is request

 

"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"

That's true, unless you create the layered PDF and its fields with InDesign.
I have to stdudy this approch and verify it avoids issue.


By @JR Boulay

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2025 Apr 04, 2025

"with level 3 (Reader Extended) protection"

This is not protection, but a restriction on use.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2025 Apr 04, 2025

What is the difference? I need to distribute the form without allowing anyone to peek into the scripts and field construction. What alternative do I have?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2025 Apr 05, 2025

"You can't have a PDF with only hidden template. An original page (that can't be delete) is request"

This is not true. In this attachement both pages are spawned from hidden templates.

What's true is that it's impossible to delete all the pages in a PDF, there must be at least one left. But this applies to all PDFs, whether the pages are spawned or static.

 

Capture_2504051442.png


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 05, 2025 Apr 05, 2025

Hi JR,

 

Thank you for sharing the sample file — it’s very interesting and well built.

 

I believe, however, that our points are not actually in contradiction. I fully agree that all visible pages in a PDF can be spawned from hidden templates, as your example correctly demonstrates. My original observation was referring to a slightly different aspect of the Acrobat document model.

 

More specifically, Acrobat does not allow the complete removal of all pages in a document. Even if no static page is visible, one page must still exist internally in the document structure — whether it’s hidden, used as a template, or otherwise. This limitation applies universally, regardless of whether pages are spawned or not.

 

In other words, the logical visibility of pages spawned from templates is fully valid (as in your demo), but Acrobat still technically requires at least one underlying page object to remain — it’s not possible to reach a this.numPages of 0.

 

So I think we’re essentially aligned: what’s not allowed is removing all page objects from the document; not necessarily that visible pages must include a static original.

 

Thanks again for the interesting exchange!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2025 Apr 05, 2025

"What is the difference? I need to distribute the form without allowing anyone to peek into the scripts and field construction. What alternative do I have?"

The difference is that a protection protects, whereas a restriction is easy to circumvent (ask Google…).


The best way to protect your scripts is to drown them in miles of useless scripts and compress/minify them, so that you can wish good luck to anyone who wants to exploit them.

In my PDFs, I place all my scripts as functions in a document script, and the fields only contain calls to these functions. And I minify the document script before releasing the document.
In addition to “protection”, this process has the advantage of simplifying maintenance, modifications and error correction in the document, as everything is centralized.

Example in the attached document. Where only the text of the alerts (placed in variables) is not minified because it causes issues with the accented characters used in French.


Another solution is to encrypt/obfuscate scripts, but PDFs containing such scripts are rejected by antivirus software, so this limits their distribution.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 05, 2025 Apr 05, 2025

Thank you for the clarification. I see how code obfuscation might be helpful in some scenarios, but in my case the form is distributed to end users via Reader, so I need a solution based on actual document protection rather than obscurity. That’s why I rely on level 3 security to enforce structural integrity and prevent access to scripts.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2025 Apr 05, 2025

Someone with just Reader can't access the code anyway.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 05, 2025 Apr 05, 2025

Yes it is so, but if someone might have Pro...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2025 Apr 05, 2025

Someone willing enough can get it even with a security policy. I would not waste my time trying to hide it entirely 100% of the time, as it's not possible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 12, 2025 Sep 12, 2025
LATEST

If the PDF is Reader-enabled with level 3 protection, then unfortunately you can’t cleanly remove or alter the initial page using standard tools. That protection level is specifically designed to prevent modifications — including deleting pages — without the owner password.

If you need to remove the initial page, the only legitimate approaches are:

  • Request the unprotected source file from the document creator.

  • Ask the owner for the password so you can open it in a full PDF editor and safely delete the page.

  • If the file was meant to be editable, the sender may have mistakenly locked it and can re-export without protection.

Any attempt to bypass or “crack” the protection would be against PDF security policy and is not something I can advise on.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines