unable to detect the default viewer

I am trying to use extraction of annotations in Zotfile.
As guided in "Goto Annotation in PDF" which says change the hidden option zotfile.pdfExtraction.openPdfWin, I am trying to find it. but there is no such thing in hidden items of zotfile.pdfExtraction
I am using Juris 5.0.9m1 and Adobe Acrobat Pro DC 2020

Can anyone tell me how to do that? thanks.
  • I am having this issue on MacOS. Default pdf viewer on my system is PDF Expert. The links to annotations do not lead anywhere (don't open the pdf let alone go to the annotated area inside said pdf). The links to the pdfs themselves work fine, just not the created links to the annotations. I'm on Zotero 5.0.89
  • Thank you for your comment. I was reffering to http://zotfile.com/ , the "Goto Annotation in PDF" part in the main page. There it says about hidden option zotfile.pdfExtraction.openPdfWin. I still can't get a working link for annotations. Did you use the hidden options?
  • Hi Yes, I've gone there ("Goto Annotation in PDF") in the main page. Unfortunately, I don't have zotfile.pdfExtraction.openPdfWin as an option in Config area (hidden options). I have explored this area but am still stuck.
  • Note that the preference extensions.zotfile.pdfExtraction.openPdfWin is obsolete as of Zotfile 5.0.13. It allowed you to set a custom pdf viewer. Step 5 below has a similar effect.

    Try the following steps for troubleshooting your problem:

    1. Make sure you've installed the latest versions of Zotero (5.0.89) or Jurism (5.0.90m2) and Zotfile (5.0.16).

    2. Create an annotation in a pdf file.

    3. In Zotero, right-click the pdf file, then select "Manage Attachments" -> "Extract Annotations". This should generate a note with zotero://open-pdf links in it. (If this doesn't work, try creating an annotation in a different pdf file.)

    4. Click these links. This should open the annotated pdf file in your pdf viewer. (In Zotero notes, you can use Ctrl+Click for opening links. You can use Ctrl+K for editing links, see here.)

    If step 4 doesn't work for you, check if the following helps:

    5. Set Adobe Acrobat or PDF Expert as your custom pdf viewer in Zotero:
    "Edit" -> "Preferences" -> "General" -> "Open PDFs using"

    6. Enter a zotero://open-pdf link in the address bar of your web browser and press Enter. If you're asked to specify an application, you might need to register a custom protocol handler for Zotero. This could depend on your operating system.

    If the suggestions above fail, you could provide a Debug ID for opening a zotero://open-pdf link. The Zotero developers might then be able to have a look.
  • thank you for your guidance. worked like a charm! this helps a lot for managing files with annotations. it was very helpful for me.
    now some more questions arise. please see if you can comment.
    1) with ctrl+click, the PDF file opens, showing the annotation. now if I switch back to zotero and ctrl+click another one for the same file, PDF viewer (Acrobat for my case) does not refresh to new page, still showing the previous page. can I solve that?
    2) every annotations (highlights, comments etc.) are imported to zotero, and a long list is generated. is there a way to customize which types to import or skip?
    3) if I make a new comment on a PDF which is already extracted annotations by zotero, when I hit "Extract Annotations" another list of notes is created. is there a way to refresh the previously extracted one?
  • thank you @qqbb
    step 4 didn't work. I tried the other steps to no avail. Debug ID: D1658348606
  • Just to clarify... whenever i click the note link (from inside zotero)... it doesn't lead anywhere (nothing happens). If I paste that note link into a browser, it will open zotero, but it will not open pdf expert (let alone lead to the page where the highlight is in the document)
  • @adamgblake: Let's hope the Debug ID contains some useful information. Did these links work for you before? Did you try step 5 above? You could try to set your custom viewer to Preview. There have also been reports of file permission issues on macOS, see here.
  • @farhangf: Here are some comments on your additional questions:

    1) If you close Acrobat and click the second zotero://open-pdf link, does this work again? If so, this sounds like it might be an issue with Acrobat. You could try a different viewer, e.g., PDF-XChange Editor.

    2) It should be possible to, e.g., remove highlights. See here. Try to put an empty value in the related hidden option. You could also try to use colored annotations, see here.

    3) Currently, that's not possible. Refreshing the note with the extracted annotations might happen in the future, though. See here. BTW, updating the note with the extracted table of contents is already working. If you create new bookmarks, Zotfile can update the attachment note with the table of contents, see here.
  • @qqbb I think they did work before. I can't recall how long ago they stopped working. I recently installed better bibtex and am wondering if that had something to do with it. I did try step 5 above, it didn't fix it unfortunately. I have a plugin called mdnotes (also recently installed) that successfully creates a link to the entire pdf (to be exported to markdown format). When I click that link from my markdown reader it successfully links to the pdf and opens the pdf in PDF Expert. The link only fails to work when it is an extracted-note link (that kind of link doesn't even open the document). I took a look at the permission issues at that website, but it didn't help unfortunately.
  • @adamgblake: It seems to me that the mdnotes plugin is creating zotero://open-pdf links: https://github.com/argenos/zotero-mdnotes/search?q=open-pdf

    If these links work in your markdown editor, zotero://open-pdf links seem to be generally working. You could copy a working zotero://open-pdf link from your markdown file to a Zotero note. If it's working correctly in Zotero notes, the link format for your extracted annotations might be problematic. Make sure that Zotfile is up to date (5.0.16).

    I think Zotfile switched to the newer format recently. In principle, the old link format should still be supported, but there might be a related problem. (You could also disable some of your Zotero add-ons for testing the links. Enable them again afterwards.)
  • I don't see how BBT could be implicated in this, but it's easy enough to test - just remove BBT.
  • @adamgblake: It might be that the links in your extracted annotations are using the wrong itemKey. I think this can currently happen if you, e.g., convert stored files to linked files. See here: https://github.com/jlegewie/zotfile/issues/483. If this is your issue, you might be able to fix your notes by replacing the item keys in zotero://open-pdf/library/items/[itemKey]?page=[page].
  • BTW, Zutilo's "Copy select item links" function can help with getting the itemKey. You could also just compare the itemKey used in your markdown files with the itemKey in your extracted annotations. If the itemKey is erroneous, you could check whether freshly extracted annotations have links that work.

    When using Zotfile's tablet functions or when converting between Stored Files and Linked Files, the itemKey for the pdf attachments might change. Currently, Zotfile's function for changing the open-pdf links seems to be broken. Zotero also provides a "Convert Linked Files to Stored Files" function.

    For avoiding broken links, it might be worth extending https://github.com/zotero/zotero/issues/1843 to zotero://open-pdf links. Alternatively, one could properly associate a note with an attachment. This might help with updating extracted annotations as discussed in 3) above. I'm not sure how Zotfile is currently dealing with cases when there are multiple child attachments for one parent item.
  • Did this issue ever get resolved?

    I am also using PDF Expert and annotation links will not work as @admgblake has mentioned. Here is the behavior I have found with PDF Expert set as system default for PDF's:

    1. With Zotero PDF Viewer Preferences set as system default Annotation links will open but with Mac Preview App and PDF's open with PDF Editor.

    2. If I set Zotero PDF Viewer Preferences set to PDF Expert, Annotation links will not work and PDF's open in PDF Expert.

    3. If I set Zotero PDF Viewer Preferences set to Adobe Reader, Annotation links work and open in Adobe Reader and PDF's Open in Adobe Reader.

    4. With Preview set as system default for PDF's and Zotero Preferences set to System Default, Annotation links open in Preview as well as the PDF's

    So it appears the problem is how Zotero and PDF Expert are working in regards to Annotation links. Is there a solution to this issue?
  • If I set Zotero PDF Viewer Preferences set to PDF Expert, Annotation links will not work and PDF's open in PDF Expert.
    This was a bug in our PDF Expert handling. It's fixed now in the Zotero beta, and the fix will be included in Zotero 5.0.91 soon. Thanks for the clear debugging info.
  • Thanks for the update. I have PDF Expert as my default system PDF Viewer but have set the default viewer in Zotero to Preview as a work around until the update.
  • Updated to version 5.0.91 (Still some issues?)

    If Zotero is set to system default for PDF Viewer, PDFs do open in PDF Expert but clicking on annotation links still open Preview (To proper page).

    If Zotero is et to PDF Expert for PDF Viewer, PDFs open in PDF Expert and Annotation links open in PDF Expert (but only to first page of PDF)

    Note: With PDF Expert set in Zotero, when you click on a annotation link I get a beep and the pdf opens in PDF Expert to the first page.
  • If Zotero is set to system default for PDF Viewer, PDFs do open in PDF Expert but clicking on annotation links still open Preview (To proper page).
    If I set PDF Expert to the system default, both use PDF Expert for me. We can look at a Debug ID for this, but easiest not to worry about it and just set Zotero to use PDF Expert.
    If Zotero is et to PDF Expert for PDF Viewer, PDFs open in PDF Expert and Annotation links open in PDF Expert (but only to first page of PDF)
    That's likely a timing issue. It generally works for me, but every so often it fails. If it fails and you try again while the PDF is still open (or even just while PDF Expert is already open), I'd guess that it would work.

    These apps don't provide an official way to do this, so we're just using AppleScript to simulate keystrokes, and if the app or PDF is still loading, the Go to Page shortcut might not work. The only option here would be to add a slight delay, but that would slow it down for everyone.
Sign In or Register to comment.