Other PDF Issues

Can Dynamic PDF Bookmarks Be Shown or Hidden?

Camila MilosovichCamila Milosovich Nov 2, 2026 869 views

Question details

The user wants to know if PDF bookmarks can dynamically show or hide in sync with the visibility of form sections in LiveCycle dynamic PDFs.

Can Dynamic PDF Bookmarks Be Shown or Hidden?
Product
PDF
Device & OS
not provided
Scenario
Working with LiveCycle dynamic PDFs that utilize show-and-hide form sections.
Observed behavior
Bookmark visibility does not automatically update or hide when the corresponding form sections change visibility.
Before you start

Before modifying your PDF with document-level scripts, ensure you have saved a backup copy, as deleting or recreating bookmarks via scripting alters the document structure permanently.

Solution 1Recommended

Use JavaScript to Add or Delete Bookmarks

Since you cannot dynamically hide or show bookmarks natively, you must use scripting to delete and recreate them as form sections change.

Dynamic show-and-hide behavior is natively not supported for PDF bookmarks. Bookmarks cannot be reliably hidden and displayed automatically simply because a document section becomes visible.

As a workaround, you can use document-level JavaScript to actively manage the bookmark tree by deleting bookmarks when a section hides and creating new ones when the section appears.

1
Identify the target form sections

Determine which dynamic form sections need corresponding bookmarks when they are triggered to become visible by the user.

2
Write a bookmark deletion script

Use JavaScript within your PDF editor to locate and execute the 'bookmark.remove()' function on the specific bookmark node when its related form section is hidden.

3
Write a bookmark creation script

Add a script utilizing the 'bookmark.createChild()' method to recreate the bookmark node, pointing to the correct page or destination, when the form section is triggered to show.

Use JavaScript to Add or Delete Bookmarks
Scripting Limitations: Keep in mind that scripting add/delete actions might not perfectly mimic native show/hide behavior and requires careful management of the bookmark tree hierarchy.
Manage PDF Bookmarks

Easily Add and Manage Bookmarks Manually in WPS Office

Since dynamic bookmarks cannot be automatically shown or hidden via properties, managing them manually is often the most reliable method. WPS Office provides an intuitive PDF editor to easily add, delete, and organize standard bookmarks without complex scripting.

  1. 1. Open the PDF: Launch WPS Office and open your target PDF document.
  2. 2. Access the Bookmark Panel: Click the 'Bookmark' icon located on the left navigation pane to reveal the bookmark tree.
  3. 3. Add a New Bookmark: Navigate to the desired page, right-click within the bookmark panel, and select 'Add Bookmark' to create a new navigation link.
  4. 4. Delete an Existing Bookmark: To remove a bookmark, simply right-click the existing entry in the panel and select 'Delete'.
Easily add, delete, and rename PDF bookmarks manually without requiring JavaScript.Highly compatible with standard PDF files and Microsoft Office formats.Support drag-and-drop bookmark organization for complex or lengthy documents.Lightweight PDF viewer and editor with a clean, user-friendly interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I hide a PDF bookmark without deleting it?

The core PDF specification does not support a native 'hidden' state for bookmarks. Bookmarks are structurally either present in the document's navigation tree or they are entirely removed.

Can I use JavaScript to control PDF form fields instead of bookmarks?

Yes, while bookmarks cannot be dynamically hidden, you can seamlessly use JavaScript to change the visibility of form fields, buttons, and specific document layers (Optional Content Groups) based on user interaction.

Will deleting and recreating bookmarks affect the PDF structure?

Deleting a bookmark permanently removes its specific navigational link from the tree. When you recreate it via script or manually, you must explicitly define its target page, zoom level, or destination to fully restore the original navigation structure.