Create a note that linked to a specific paragraph in a pdf

Actually, there is a quite simple way to make references to exact positions within pdf files. I used to do it manually once (unfortunately, I can’t script to make the process automatic). But I’m not a programmer and don’t know how difficult is to implement it and how useful it would be for other users.

The things needed are:

  1. a simple pdf-annotating tool embedded within Obsidian,
  2. a search engine that can search and preview pdf files and show “hits”, and
  3. little programming.

The functionality should work like this:

  1. You highlight a passage, take notes, annotate, and do all your work within a PDF file using the embedded pdf-annotating tool. I believe, this is already a requested feature.

  2. If you wish to make a reference, you will select an option “Create an anchor (reference)” and insert the cursor in a place in the PDF file where you want to create it.

  3. The program will create an anchor at the exact place by inserting a little text in the PDF file with a generated unique string of characters (perhaps using the exact time stamp). The string will be copied to the clipboard.

  4. Now, you should just paste that string in an Obsidian file with a special syntax – let’s call it a “pdf block link”. The string doesn’t need to contain the name of the pdf file, since it’s always unique.

  5. Later, by clicking on the pdf block link, the system launches the indexed search for that string in PDF files, finds the hit and previews the pdf file in the exact position.

So, it works in a way similar to block references in Obsidian.

Visually, the anchor string should be invisible or barely visible in the PDF file (for example, small, transparent style letters can be used). Or the string in the pdf file could appear as a little anchor icon (so that you can see, where you have your anchors; you can move them around to adjust their position; and you can copy their id-string to create a pdf block link to it in an Obsidian file, when necessary; and so on). Sure, there are plenty of possibilities here.

The good thing is that these links won’t be broken by renaming or moving pdf files within your vault – the search engine will automatically reindex all the files that has been modified or moved and find the unique string in a new location without any problems.

You don’t even need OCR-processed files – because you can write (i.e., create anchors) even on top of images. So, this method can work also with images - you can for example refer to the exact point in the image.

The method can be adjusted for other file types that can be edited, searched, and previewed by the search engine with hits higlighted.

I used to do this manually using PDF X-Change Editor (for annotating PDFs and manually creating “anchors”) and DtSearch Desktop (for searching the “anchors” in the PDF files). After manually creating an anchor in a PDF file, I just copied the string into my note-taking app. And when I wanted to find the exact location in the source PDF file, I just ran the desktop search for that string. But any pdf annotation tool (that can write on top of PDF) and any search engine (that can search PDFs and highlight “hits”) will do.

9 Likes