links to annotations on pages with roman numeral pageLabels do not work
Zotero 7.0.30
Obsidian 1.10.6
Adobe Acrobat
Zotero Integration
I annotate PDFs using Acrobat. I use Zotero Integration to import those annotations from Zotero into Obsidian. This all works flawlessly, except when annotations are on pages with roman numeral pageLabels, typically frontmatter.
This is a snippet from my latest attempt: {%- elif annotation.annotatedText %}
{{annotation.annotatedText}}[(p. {{annotation.pageLabel}})]({{annotation.desktopURI}})
The link, and other variations I have tried, opens up the PDF to the correct page when the pageLabel is an arabic number. However, in all cases where the pageLabel is a roman numeral, it merely opens up the PDF, usually to its first physical page, with a dialog box stating "There is no page numbered 'NaN' (Not a Number) in this document."
Is there a solution for this issue?
Obsidian 1.10.6
Adobe Acrobat
Zotero Integration
I annotate PDFs using Acrobat. I use Zotero Integration to import those annotations from Zotero into Obsidian. This all works flawlessly, except when annotations are on pages with roman numeral pageLabels, typically frontmatter.
This is a snippet from my latest attempt: {%- elif annotation.annotatedText %}
{{annotation.annotatedText}}[(p. {{annotation.pageLabel}})]({{annotation.desktopURI}})
The link, and other variations I have tried, opens up the PDF to the correct page when the pageLabel is an arabic number. However, in all cases where the pageLabel is a roman numeral, it merely opens up the PDF, usually to its first physical page, with a dialog box stating "There is no page numbered 'NaN' (Not a Number) in this document."
Is there a solution for this issue?
Upgrade Storage
This does not work for me, to open the pdf to a page with a roman numeral pageLabel: zotero://open-pdf/library/items/G337A94X?page=vi
This does work for pageLabels with arabic numbers: zotero://open-pdf/library/items/G337A94X?page=3
When I create an annotation on page iii in a Zotero note and then copy that annotation to a Zotero note and then copy from there into a text editor, it's
zotero://open-pdf/library/items/BEPMNZ42?page=3&annotation=AKAGJ6KP
i.e. even though iii is recognized for citation purposes, it uses the absolute page number for the annotation. Opening an annotation on the actual p. 3 of the PDF is
zotero://open-pdf/library/items/BEPMNZ42?page=7&annotation=P269TU6D
the links also include the annotation IDs, presumably for more reliable linking.
[(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}})
which renders, for example, these links to different annotations in the same pdf file:
zotero://open-pdf/library/items/G337A94X?page=iv&annotation=highlight-p4x251y830
- this does NOT open the pdf to pageLabel iv, which is physical page 4
zotero://open-pdf/library/items/G337A94X?page=3&annotation=highlight-p13x290y541)
- this DOES work to open the pdf to pageLabel 3, which is on physical page 13
I'm trying different combinations of the variables, and so far note a couple of observations:
- the use of {{annotation.pageLabel}} in the [link text] recognizes the correct page, whether roman numerals or arabic;
- the use of {{annotation.pageLabel}} in the URL recognizes the correct page whether it has roman numeral or arabic pageLabels, but does not cause the link to open to that page if the pageLabel is a roman numeral; and
- all works as expected if there are no pages in the pdf with roman numeral pageLabels.
The conclusion I've reached is that links to annotations in pdfs containing roman numeral page numbers do not work to open the pdf to the correct pages.
If you go back to my first question, I didn't ask you about the output of your template, but about copying the Zotero annotation added to a Zotero note -- I don't think you ever did that, that'd be the first thing to check. Once you've gotten this to work with purely Zotero features, you'll be able to properly report the issue to the Obsidian plugin developer.
One related issue: in Zotero Reader, the page box it the toolbar shows a minus sign (-) for those pages in the pdf that have roman numeral page labels. This only creates an issue if Zotero Integration is used to import annotations into an Obsidian note. The roman numeral page numbers are not shown, instead the minus sign is substituted for each roman numeral, like this: (p. -). Would it be possible to fix this in Zotero Reader?
For example:
[(p. 9)](zotero://open-pdf/library/items/QLYH9EX6?page=9&annotation=5AXG562R)
And furthermore, using roman numerals in the URI is actually supported. I tested this by replacing the 9 with IX and it still took me to the right place in the PDF:
[(p. 9)](zotero://open-pdf/library/items/QLYH9EX6?page=IX&annotation=5AXG562R)
The above works, see this demo:
https://s3.amazonaws.com/zotero.org/images/forums/u5945431/dkjpa8vz7595hzp3x6ms.gif
It seems like the real issue is the missing annotation ID.
---
I can also confirm Adam's finding that when you extract annotations from pages with roman numerals to a note, the URI therein works, and uses the arabic page number in the link, not the roman page label:
([Sample, 2022, pp. -](zotero://select/library/items/RQ2HE5NM)) ([pdf](zotero://open-pdf/library/items/VTL4PG93?page=3&annotation=U23SGZCM))
Importing the same annotation to Obsidian with the Zotero Integration plugin, I get this link: [(p. -)](zotero://open-pdf/library/items/VTL4PG93?page=-&annotation=U23SGZCM)
Which actually works. I tested on this random test document: https://www.liberty.edu/casas/academic-success-center/wp-content/uploads/sites/28/2022/05/Turabian-NB-format-FINAL-04232022.pdf
This could be a template issue. Perhaps it's a different part of the for-loop that's executing, rather than the one you're editing?
These are random highlights made in the pdf, the first four on pages with roman numeral page labels; the last on a page with arabic number 1 as the page label:
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/9ss0p7rjt6qb393vdg9r.png
This is my Zotero Integration template section for highlights, which includes {{annotation.id}}:
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/sbz0uhns7vmh7jdc9s9o.png
I imported these annotations into Obsidian from Zotero in two versions: (1) using the "System Default" Reader, Adobe Acrobat, and (2) using the Zotero Reader. In Obsidian, reader view, both versions appear the same:
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/lrhp0hs4w7cimmz2jxgt.png
However, the same template produces different results for the {{annotation.id}} variable, which can be seen in Obsidian's editing view. Acrobat renders page coordinates instead of the actual "id":
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/vvf5mlg9t4tlybn6c4g5.png
Zotero Reader renders the actual "id":
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/q4rtdijmymqf1vpcxl6o.png
Zotero Integration: Data Explorer shows the same values for both readers:
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/pa6618m057iydz0gfjem.png
Here is the crux of the issue: when I click on the above link (p. v) to open the pdf in Acrobat to page v, this is the result:
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/f1yun2v30kvauuc2e4l0.png
But, as I stated in a prior post, clicking on the same link to open the pdf in Zotero Reader to page v, takes me to the target page v.
I wish I knew, but this may explain why the links to pages with roman numeral page labels do not work if I use Acrobat as the pdf reader.
But, now a newer question is why the same Zotero Integration template produces different URLs, one with page coordinates when using Acrobat, and another with the actual "id" when using Zotero.
__________________________
On the related issue, in Zotero reader, the page box in the toolbar shows a minus sign (-) for pages with roman numeral page labels, I tested a different pdf with roman numeral page labels. I made annotations using Zotero Reader. The following one is on a page with page label iii, and the page box shows a minus sign for this page:
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/9habwttmo5mk8zpagjey.png
The annotation imported into Obsidian has a minus sign link (p. -) instead of (p. iii). It did, however, take me to the correct page iii.
https://s3.amazonaws.com/zotero.org/images/forums/u6755731/guoxjnrzbpatu8szbblw.png