4

From my website, I'm linking several sections within a PDF document using URL in format http://www.example.com/Document.pdf#nameddest=sectionXY (as discussed e.g. here). My PDF document is manually created from a DOCX document using the "PDF export" function in MS-Word 2016. The labels are marked as MS-Word bookmarks in the source document.

Unfortunately, the PDF viewer in the web browser scrolls to the proper section only in the Google Chrome. In other browsers (FireFox, IE 11 or Edge) the PDF document is always opened on the first page.

I'm sure my solution used to work several years ago both in Chrome, FireFox and IE.

Is there any way to make it work at least in Chrome and FireFox? I'm able to use another converter (or even some PDF library) but I cannot afford to have my source document in any other format than DOCX. I'm even able to mark my "labels" another way than using MS Word bookmarks.

Farhana Naaz Ansari
  • 7,524
  • 26
  • 65
  • 105
Jan Šotola
  • 842
  • 8
  • 25

2 Answers2

1

Word's PDF export may or may not create "named destinations" in the PDF file. It seems to vary based on platform (Mac vs Windows) and by version (2010 vs 2016).

LibreOffice can import .docx and has PDF export with specific options for creating named destinations from the document bookmarks.

Chrome uses PDFium Firefox uses PDF.js as its built-in PDF viewer, both of which support navigating to named destinations with #nameddest=sectionXY as well as some other navigation styles specified in RFC like #page=2. (See a related question on linking to sections.)

You can check your PDF file for named destinations with Popper's pdfinfo or other tools (see a related question on Unix.SE about listing named destinations).

Community
  • 1
  • 1
RJHunter
  • 2,829
  • 3
  • 25
  • 30
0

This is probably not something you'll be able to change.

The PDF standard itself for instance does not really specify whether links like the one you posted should work. So support for them is not something you commonly find.

Of course if the browser is open source, you may always post a pull request.

Joris Schellekens
  • 8,483
  • 2
  • 23
  • 54
  • 1
    RFC3778 specified fragment identifiers like `#nameddest=...` for PDF URIs, and now ISO 32000-2 (the newer PDF standard itself) apparently includes similar information. – RJHunter May 10 '18 at 04:40