If you have a link in a PDF which points to a page within the same document, is there any way to get the number of the page pointed to to appear in the right hand margin opposite the link, so that someone using a hardcopy of the PDF can see which page the link points to?

I have looked at using Adobe Acrobat, PDF X-Change Editor, Nitro PDF, or PDF Annotator (on Windows) but none have a facility which could do this.

  • take a look at this answer and it's comments - stackoverflow.com/a/38591541
    – Madhubala
    Sep 5 at 10:57
  • That addresses how to obtain the target page number but not how to get the number to appear in the right hand margin opposite the link.
    – Nemo
    Sep 5 at 13:47
  • there are many linux tools to do that ;Also give a try to this : flavianopetrocchi.blogspot.com
    – Madhubala
    Sep 5 at 14:17
  • As far as I can see that link (JPdfbookmarks) is simply for editing bookmarks. What I want to do is have the page number appear in the right hand margin opposite each link.
    – Nemo
    Sep 5 at 14:58
  • i think you are better off with scripting ; good luck and yeah that JPdfbookmarks lacks those features
    – Madhubala
    Sep 5 at 16:32

Use a word processor - commercial ones like MS Word, free ones include LibreOffice or OpenOffice. Edit the file as a text document. For example - https://ask.libreoffice.org/t/how-do-i-add-internal-links-to-a-document/53769

To make the link target page number appear in the margin - use macros. All word processors I have used support macros.


I have linked to LibreOffice as its free - as in beer. You may also use M$ Word.

Both LibreOffice and Word allow you to export as pdf. In general, you will find more flexibility in pdf creation if you use a word processor and export as a pdf.


  • In my experience conversion of PDF to Word and conversion of Word to PDF rarely works exactly. There are always formatting changes introduced. So I am looking for a solution which can be applied directly to the PDF without going through a "convert then convert back process".
    – Nemo
    Sep 1 at 9:18
  • Its a hit and miss. I use LibreOffice to generate a pdf UserGuide for plugins. Most of the formatting does work. The macros may be hit and miss, but its worth a try.
    – moi
    Sep 1 at 11:49

There is no simple automatic way to do this incorporated in the "main" pdf softwares, as you yourself have noted. Moreover, pdf links not always reference page numbers, but also "Named Destinations" (a specific location on a page, associated with a view and a zoom level) as you can see on my screenshot below.

enter image description here

So, the problem is actually somewhat more complicated, as you need to go "one hierarchy deeper" to extract the page numbers. There's an advaced tool called AutoBookmark Plug-in which has a "Link Inspector" which will show you the linked page numbers if you hover over a link, but that tool stil won't do what you're asking for.

What you ask for can for sure be done using the JavaScript console embedded in Adobe Acrobat, there are people which have addressed similar problems, (for example here or here). But this will need programming skills and a good knowledge both of JS and of the pdf's JS-console, so it's not a "user-friendly" solution.

If you need to do this on a regular basis, I'd hire a professional programmer to do the JS for you.

If you need to do this once or twice, I'd either print the pdf and do it by hand, or insert a text / comment box on my right margin, and insert the page numbers for each link (using the above "link inspector). Up to about 100 - 200 links, it will be a pain but doable. See screenshot below:

enter image description here

This is maybe off-topic, but you could also consider getting a tablet with a e-ink-screen, such as the boox note pro or the remarkable 2, for reading and notetaking "almost like on paper".

  • If it makes it any easier, in the particular application I am thinking of all of the links will point directly to page numbers. There will be no links pointing to named destinations.
    – Nemo
    Sep 5 at 8:51
  • @Nemo so you will create that pdf yourself from another application ?
    – 1NN
    Sep 5 at 17:12
  • Yes. That is right.
    – Nemo
    Sep 5 at 17:52
  • @Nemo - then it is probably EASIER to insert those page numbers already from your pdf maker, rather than inserting them once your pdf is made.
    – 1NN
    Sep 5 at 19:29
  • Unfortunately that application software does not have that facility.
    – Nemo
    Sep 6 at 10:25

You can use jPDF Tweak to accomplish what you want. It is a free tool written in Java.

  1. Download and start jPDF Tweak
  2. Load your PDF document (Input tab)
  3. Go to the Bookmarks tab and check Change chapter bookmarks
  4. Now Load from document - you will see all your bookmarks listed with pages they link to
  5. Edit bookmark titles to include page numbers
  6. Go to the Output tab to save your new document

Update: Using PDFedit to add some text to a page. Adding text with PDFedit

  • As far as I can see that would simply add the page number to the bookmarks. What I want to do is have the page number appear in the right hand margin opposite each link.
    – Nemo
    Sep 2 at 18:25
  • I'm sorry I misunderstood your question. Your best bet would be PDFedit then. It is a bit old and may complain about the unsupported operators present in file but should work.
    – cezaryta
    Sep 3 at 5:44
  • PDFedit appears to require technical knowledge of the internal structure of PDFs. I am looking for something more user friendly. Not necessarily completely simple but not directly manipulating the internal codes and structure.
    – Nemo
    Sep 3 at 9:25
  • You originally thought (wrongly) that I was looking for a way to add page numbers to bookmarks. Is there anything in the way I worded the question which misled you? Can you suggest any changes in the wording of my question which would have made it clearer to you that I was looking for a way to add the page number pointed to by a link in the right hand margin of the PDF page itself opposite the link?
    – Nemo
    Sep 3 at 16:35
  • No, you question is correct. While considering possible solutions to your problem I somehow mixed links with bookmarks in my mind :-) Never mind. I have added a demonstration of how to use PDFedit to add text (page numbers) to your pages. Are you going to do this on a regular basis?
    – cezaryta
    Sep 6 at 6:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.