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

I don’t know anything official, but I wouldn’t bet on this anytime soon. I imagine this kind of feature would require building a PDF handling engine from the ground up. (That’s based on the knowledge that only a select few PDF editors can do this kind of linking at present, and they are all exclusively PDF apps…)

1 Like

@DarrenMcDonald Hook can do something similar. See for example here, especially the section entitled “Hook and reference management software (PDFs)”. I wonder, if anyone can/want showcase her or his workflow with Hook and Obsidian.

3 Likes

Interesting that Roam Research and Remnote has already has this feature. Roam Research as an extension and Remnote has it built into the app.

1 Like

Both of these apps have a different fundamental data structure than Obsidian.

In Roam’s case, I assume you mean the extension mentioned here: https://mobile.twitter.com/cococ_rr/status/1366654227506991105

If so, it uses Roam blocks to emulate highlight locations.

As for RemNote, it’s purpose-built with this feature in mind.

It might be possible in Obsidian someday, but it makes more sense for a good PDF editor to provide this functionality and for Obsidian to leverage that app than for Obsidian to build it from the ground up. (After all, shouldn’t we be able to link to and use these annotations outside the context of the note-writing app?)

zotero has a plugin called zotfile,it can extract highlights and annotations from pdf files edited by acrobat pro 11. and there is another zotero plugin named mdnotes, which could export all the zotfile-extracted notes and metadata of a item in zotero to obsidian in md format. and you can jump back to pdf paragraph when both obsidian and zotero are opened.

2 Likes

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

Thanks @ryanjamurphy for your input and clarification. I am not a programmer. I will leave it to people like you who understand how things work under the cover. :slight_smile:

I would find Obsidian useful as a tool for my academic research if it you were able to highlight PDFs, make notes on the text (OCR?) from the highlights and have this text link back to where they were made in the PDF so that I can see the highlights in context.

In find most PDF editors/readers very frustrating to use because they have you making comments in bubble notes that are hidden the moment you move on to the next comment. I need to be able to have all my comments open because I refer to them when writing the current note. So having the PDF feature in Obsidian would be fantastic! :slight_smile:

6 Likes

Thanks @Slavomir for your detailed explanation. You may not be a programmer, but you are a power user. :slight_smile:

Is there any detailed “how-to” description of the steps you use for absolute beginners?

Ok, I have for some time been taking a very deep dive into PDF - summary : it is hard to believe such a fckd up format got so big, Adobe really have a lot to answer for.

However, there is a way to do what is asked, that is use of namedestinations, which can be created most easily by use of pdfmarks.

It is a long, long story, the info is available but it is like some family secret and very difficult to really distill down to these two key facts.

If you search those two terms you will find what you would need to know to add this feature programmatically. Msg me if you really need to know more but I only went as far as I needed for my particular use at the time - it took months to get to the final key details I needed.

3 Likes

Ok, I have for some time been taking a very deep dive into PDF - summary : it is hard to believe such a fckd up format got so big, Adobe really have a lit to answer for.

However, there is a way to do what is asked, that is use of named destinations. These are what you use to open a PDF at a specific section (as opposed to page #).

You add #nameddest= to your file/url when you open it. A named destinations will change as the PDF changed as it has an extra level of indirection allowing it to associate with a “section” instead of a page.

You can make a named destinations in some PDF editors, or convert a bookmark or link destination etc.
into a named destination. (eg using autobookmark or debeneu).

But, the hidden secret that is out in view, if you know to look, is the use of pdfmarks - this is the key and would easily allow this feature to be implemented and they are a “layer” that goes in at the distilling (ghostwriting) phase of pdf generation, turning PostScript into PDF.

Search and you will find.

1 Like

Use case or problem

Highlight keywords in PDF reader and a link is created in our note. Clicking on this link in the notes will then open the PDF at the correct page

Proposed solution

enable highlighting in PDF and right click menu will have both

  • paste text
  • paste link to reference

Current workaround (optional)

The only feature in Remnote that I miss

Video below of Remnote implementation (still buggy but works)
PDF highlight link to page (streamable.com)

1 Like

I like your proposed implementation. But, in case you were unaware, a similar feature was implemented in 0.10.8. Here’s a quote from the release notes:

  • You can now link to a page of a PDF file by adding #page=number at the end. For example [[My file.pdf#page=3]]. This also works for embedded PDFs. Typing #while auto-completing a PDF file will automatically add #page= for you.

Edit: Just realized your post was either merged or originally part of this thread. I’ll still leave the information here in case.

Anyways, good idea.

Thanks.

6 Likes

As the Upper mentioned, another electron based local PKM tool Logseq implement it recently(2021.08.06).

Hoping we could get this feature as well. :slight_smile:

3 Likes

+1 Vote for this!

1 Like

Maybe the obsidian team could develop a preliminary core plugin first to allow inserting pdf link “[[myfile.pdf#page=x]]” like what the plugin Media Extend did with the timestamps.
image

i think if the just make it work better with reference managers makes more sense. zotero already would let you to link to pdf pages inside it’s library. i think even Citation plugin can add a feature to link to a page. it already supports linking to pdf, just need to make linking more user friendly for pages. like just hitting a hot key and search for the book by some metadata, select it in the list and then prompted to enter the page number and hit Enter to make the note (with a predefined format) and the link to zotero in it.

when working with Zotero, you need to finish reading pdf and then export annotations by Zotfile plugin to export pdf to a markdown file in obsidian, and the exported markdown file got refreshed every time when you want to re-export anything in that paper.
the point is that the reading experience in reference managers method is divided and not at smooth as Logseq style when you could copy the source in pdf and comment on that snippet any time you wish during the pdf reading and not have to experience any "stop to export“ process。

1 Like

i understand that, it is annoying for me too, but i don’t think it is possible for obsidian to work as a reference manager. i don’t know about the logseq and how it handles it’s pdf files but keeping huge amount of files inside obsidian is not manageable right now and i don’t see any sign that it is going to change in the future, so it is a trade-off imo.

it is also seem possible to add an auto sync feature between zotfile+mdnote and obsidian. I know it is not easy/probable but that is an option to solve this issue too

For now, I just want a more convenient way to create a link format like [[myfile.pdf#page=x]]. The plugin media extended already have a function to create timestamps pretty fast, please check it out Create a note that linked to a specific paragraph in a pdf - #33 by Ocarinalover.