Skip to content

Conversation

Ovgodd
Copy link
Collaborator

@Ovgodd Ovgodd commented Sep 11, 2025

Purpose

This pull request introduces PDF bookmarks (outline) support in exported documents.
The goal is to provide an accessible outline structure based on document headings, in line with WCAG/RGAA requirements for navigable documents.

issue 1335
SignetON

Proposal

  • Add bookmark attributes to exported headings in the PDF renderer.
  • Enable outlines by setting pageMode="useOutlines" so that bookmarks are visible in PDF readers.
  • Ensure each heading (h1, h2, h3, …) is represented in the outline structure.
  • Known limitation: although the outline is displayed correctly in Acrobat Reader and Firefox PDF Viewer, clicking on bookmarks does not reliably scroll to the correct heading

Investigations performed

  • Tried attaching unique id values to headings.
  • Tested with invisible anchors positioned before headings.
  • Experimented with top, left, and fit options on bookmarks.
  • Tried assigning explicit destination values (dest).

👉 In all cases, the behavior remains the same: all bookmarks on a given page point to the same destination (the last heading).

In my opinion the issue seems to be a limitation/bug in @react-pdf/renderer v4: bookmarks are generated in the outline but do not create unique destinations per heading.

Copy link

github-actions bot commented Sep 11, 2025

Size Change: +70 B (0%)

Total Size: 3.66 MB

Filename Size Change
apps/impress/out/_next/static/bd3598a5/_buildManifest.js 0 B -888 B (removed) 🏆
apps/impress/out/_next/static/fdfd8ce6/_buildManifest.js 889 B +889 B (new file) 🆕

compressed-size-action

@Ovgodd Ovgodd force-pushed the fix/1135-bookmarks-pdf-exported branch 4 times, most recently from 66d2802 to f3dea3d Compare September 16, 2025 07:02
@Ovgodd Ovgodd changed the title ✨(backend) add pdf outline property to enable bookmarks display ✨(frontend) add pdf outline property to enable bookmarks display Sep 16, 2025
@Ovgodd Ovgodd requested a review from AntoLC September 16, 2025 07:02
@Ovgodd Ovgodd marked this pull request as ready for review September 16, 2025 07:03
@Ovgodd Ovgodd force-pushed the fix/1135-bookmarks-pdf-exported branch from f3dea3d to 3060ccc Compare September 16, 2025 07:07
Copy link
Collaborator

@AntoLC AntoLC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ !

allows pdf viewers like adobe reader to display bookmarks in the sidebar

Signed-off-by: Cyril <[email protected]>
@Ovgodd Ovgodd force-pushed the fix/1135-bookmarks-pdf-exported branch from 3060ccc to 5fc0026 Compare September 16, 2025 12:30
@Ovgodd Ovgodd merged commit 5fc0026 into main Sep 16, 2025
21 of 22 checks passed
@Ovgodd Ovgodd deleted the fix/1135-bookmarks-pdf-exported branch September 16, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants