react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Bookmarks all link to last page in document

Open danomatic opened this issue 1 year ago • 10 comments

Describe the bug All bookmarks link to the very last page

To Reproduce

  1. Open repl link: https://react-pdf.org/repl?code=3187b0760ce02e00408a057025803c450298c0bc300500943807cf805030c00f0022230080b61985311655400a02180e658212005e19b00220032014400aace90095c4c0046204006b463c013a689bc04c008ce3da54bd5646146c8d6135403d0dbb172cb871fa839843442465e49455d4b475f50df8b00099cc38aca8ddec6261625c527da99dbd13b8d202c4a4e41594d435b4f40dc4fc019812ad38b3eb336cd91272f3399ce8199959d80801b8c8c914307980a0b86800c400e97458004c3174f0a91151d0b19d8846c88000
  2. Download file
  3. Open file
  4. Open table of contents
  5. Click bookmark
  6. Notice that all bookmarks jump to the last page

Expected behavior Bookmarks should link to the page that they were placed on

Screenshots Screenshot 2024-04-02 at 6 04 03 PM

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Any
  • React-pdf version: v3.4.2

danomatic avatar Apr 03 '24 01:04 danomatic

The issue goes away if I revert to v2.3.0. All ^v3 versions that I tried had the bug.

danomatic avatar Apr 03 '24 01:04 danomatic

What's so strange is this seemed to work with other v3 versions, but after about 24 hours of total dependency hell and battling with installing different versions, for the life of me I can't find one that doesn't have broken bookmarks. This is breaking a production application in a crucial way. Any help our guidance would be appreciated.

danomatic avatar Apr 03 '24 18:04 danomatic

The issue goes away if I revert to v2.3.0. All ^v3 versions that I tried had the bug.

Hi @danomatic which node version you are working with.

asthaawasthi-laitkor avatar Apr 23 '24 10:04 asthaawasthi-laitkor

I have the same problem. I'm using node v18.14.0

hormiai76 avatar May 03 '24 13:05 hormiai76

For now I'm avoiding the issue by pinning @react-pdf/pdfkit to the last working version in yarn:

  "resolutions": {
    "@react-pdf/pdfkit": "3.1.0"
  }

danomatic avatar Jul 25 '24 05:07 danomatic

Anyone know a version 3 release that works?

sbuys avatar Jul 26 '24 06:07 sbuys

For now I'm avoiding the issue by pinning @react-pdf/pdfkit to the last working version in yarn:

  "resolutions": {
    "@react-pdf/pdfkit": "3.1.0"
  }

Thank you!

sbuys avatar Jul 26 '24 06:07 sbuys

Same issue here:

  • "@react-pdf/renderer": "4.1.5",
  • node: v22.11.0

amaury-hanser avatar Dec 03 '24 08:12 amaury-hanser

Still an issue with the latest release of @react-pdf/renderer, 4.1.5

stephenjudkins avatar Dec 05 '24 19:12 stephenjudkins

If it helps others, this is the pnpm patch I'm using to work around this for now:

@react-pdf__pdfkit.patch

EvHaus avatar Mar 29 '25 22:03 EvHaus

I'm also having this issue. When opening the PDF in Chrome and using the bookmark navigation, it only will take me to the last page

alee8648 avatar Jul 17 '25 10:07 alee8648