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?
  • Can you provide a Debug ID for it happening?
  • D1630363268
  • Is this functionality provided by a plugin? If so, you'll need to contact the plugin's developer.
  • (Just to confirm, Zotero's own "Go to Page" functionality for annotations added to notes does work for Roman page numbers)
  • The following are two examples. I assume these links are what your referring to as the "Go to Page" functionality.

    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
  • but where is that link coming from?

    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.
  • If I am answering your question correctly, my links are coming from my template:

    [(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
  • what happens when you change the first one to say page=4?
  • To do this, I changed the template to use page={{annotation.page}} in place of page={{annotation.pageLabel}}. The link, then, opens the pdf to page 4 of the pdf, but not the target annotation which is on the earlier page iv.

    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.
  • to add to the above, using {{annotation.page}} opens the pdf to pageLabel 4, which is physical page 14; pageLabel iv is physical page 4.
  • In trying to find some clarity in this discussion, I removed all the roman numeral page numbers from the subject pdf, and reset the pageLabels using only arabic numbers. Links to annotations opened the pdf to the correct pages, whether the physical page itself had a roman numeral or arabic page number.

    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.
  • As I said, this is working for me, so it's not the case that it does not work. It does sound like the Obsidian plugin generates theses incorrectly.
    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.
  • @adamsmith I didn't understand your first question, but, after your last, I think I do. The links to annotations created in "the Obsidian plugin" (Zotero Integration) or a Zotero note both work, provided I use Zotero Reader. The links do not work if I use Acrobat as the reader. I wish I knew why. The good news is that using Zotero Reader is a solution to this issue. So, thanks for your guidance and patience.

    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?
  • In my testing, Zotero Integration does usually produce valid links with the annotation ID at the end.

    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
  • edited 5 days ago
    @-william- Your URIs ought to have annotation IDs. How come the examples you shared don't? Can you mention an item you're testing this on, so I can test it too?

    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?
  • edited 4 days ago
    I have now tested annotation imports and URIs from two different documents with roman numerals in the frontmatter, imported into Obsidian via Zotero Integration, and both imports produced valid URIs that linked directly to the right spot in the PDF.
  • Thanks @FeralFlora -- I wonder if the problem is actually the PDF william is trying:
    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.
    That shouldn't be the case and isn't the case for me for PDFs with roman numerals. I wonder if the PDF metadata (as in, which pages have roman numerals) is broken for the PDF in question. I don't think you can fix this in Zotero, though -- that'd have to be an actual PDF editor.
  • I used a different PDF.

    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
Sign In or Register to comment.