Question about Navigating to a Specific Location in a PDF via Zotero

57 views
Skip to first unread message

Hwi Kwon

unread,
Jun 16, 2025, 9:51:09 PMJun 16
to zotero-dev
Hi, I’m wondering if there’s a way to programmatically navigate to a specific location in a PDF using the Zotero API or its internal reader.

I’m working on implementing a RAG (Retrieval-Augmented Generation) plugin and would like to highlight or jump to a referenced section within a PDF. I considered creating a temporary annotation and jumping to it, but I couldn’t find any API for creating annotations programmatically.

Is there any supported or even unofficial way to achieve this functionality?

Any guidance or suggestions would be greatly appreciated.
Thanks in advance!

Abe Jellinek

unread,
Jun 16, 2025, 10:32:41 PMJun 16
to zoter...@googlegroups.com
Do you mean navigating to a specific page? If so:

Zotero.FileHandlers.open(attachment, { pageIndex: 6 });

You create annotations like any other item (new Zotero.Item('annotation')), but you shouldn’t need to do that for this.

--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/zotero-dev/e4e830d4-35c9-42c1-b2eb-7cdbe0cf0b16n%40googlegroups.com.

Hwi Kwon

unread,
Jun 16, 2025, 10:38:28 PMJun 16
to zotero-dev

My objective is to display the source content retrieved through RAG directly within the Zotero document for the user. 

Since I wasn’t able to find a method to highlight text without using annotations, I ended up implementing the highlighting using annotations instead—specifically, by utilizing the annotationManager from the Reader.

I was wondering if there might be any alternative approach to achieve this—perhaps by using other functions provided by the Reader, or by accessing pdf.js directly?


Thank you. 


2025년 6월 17일 화요일 오전 11시 32분 41초 UTC+9에 Abe Jellinek님이 작성:
Reply all
Reply to author
Forward
0 new messages