[New Plugin] PDF Preview in Right Sidebar

edited July 16, 2022
Hi everyone! I just spent an afternoon developing this new plugin Zotero PDF Preview, which I think is an excellent solution to this discussion. Thanks to Zotero 6 's integrated pdf.js, it is effortless to do a preview.

You can select items in the library view and the PDF preview(first 10 pages) will appear inside the right bar! Fast & easy.

See https://github.com/windingwind/zotero-pdf-preview for download and more information.

I've added some new features to the Zotero PDF Preview. Go to Edit->Preferences->Preview to enable/disable them:

- Preview with annotations/inks. It's disabled by default to speed up the preview.
- Dark mode of the preview
- Number of pages to preview. It's 10 by default to speed up the preview.
  • Good morning! It looks fine, but I think you should change the name of the new tab, as there is already another plugin that creates a tab with the same title (a citation preview).


  • @warguelles Thanks for the suggestion! Users could vote on which tab name we use.
    Alternatively, maybe I could provide a setting to allow users to define the tab name. For most users 'preview' may be clear enough.
  • That's beautiful. I wonder if it could also be used to create a "cover view" (first page) rather than a list view? Calibre for instance has such a feature. Also, for PDFs which have been annotated by the internal system, it would be nice to see these annotations in the preview also - this way, I can easily spot the files on which I have worked a lot?
  • I would name the tab “Attachments”. That’s consistent with the language Zotero uses
  • IMHO this should be incorporated into the main software, it's just so good!
  • Hmm, after a bit of testing, this seems to fill up my RAM quickly, after previewing a bunch of files Zotero uses 5GB instead of 1GB of RAM. Are the previews closed correctly?
  • IMHO this should be incorporated into the main software
    I don't think this is the preview approach we'd go with. See my comment here.

    (I think a cover view is an interesting idea, though.)
  • edited July 14, 2022
    Maybe add a preference to set the number of pages in the Preview ? One page might be enough for most people (and might also reduce memory use ?). Or just have it default to (single) Page View, so you only load/scroll to later pages if you really want to ?

    Can it deal with more than one PDF attachment for a parent item ? It does not seem possible to click on the specific PDF (of two or more) you want to view and have it Previewed. PDF loading into Preview only seems to be triggered by clicking on the parent item. And if you click on the attachment PDF (which instead shows the usual Zotero PDF file pane), clicking back on the parent no longer triggers Preview. You have to click on another (parent) item and then come back to the item you want Previewed.
  • @burgarth
    Thanks! I'll try to figure it out and fix it soon!
  • Please update to v0.0.3:
    You can now set the number of pages to preview in the Edit->Prefs->Preview

    The memory usage bug is fixed.
  • Thanks @hsiangyu_wong . I set my pages to view to 1. There now appears to be a bug whereby clicking a (parent) item goes straight to the the Preview PDF tab, instead of to the tab that was previously selected (usually the Info tab). Upon clicking on a new item the 'correct' tab flashes up very briefly but then swaps to the Preview tab.
  • @warguelles
    The v0.0.4 allows users to customize the tab name
  • @timwr820
    This is because the auto preview is enabled by default. Go to Edit->Prefs->Preview and uncheck the 'Auto Preview PDF' to disable this behavior.
  • Thank you @hsiangyu_wong , it's working on my systems.

    PS. If you also want previewing in Windows Explorer using Adobe Reader, it can be done too, see https://helpx.adobe.com/acrobat/using/enable-pdf-thumbnail-preview-windows-explorer.html
  • edited July 14, 2022
    Aah, so that's what that setting means. ;)
    But that setting is not really necessary. You can just go with the way Zotero handles all the other tabs. eg if you select the Tags tab on one item, that becomes the default display tag for the next item you select. Your Preview tab already works that way when Auto Preview is OFF (ie it achieves basically the same 'auto' functionality). Maybe there's another use case for Auto Preview ON but I can't think of it.
  • The memory usage bug is fixed.
    The v0.0.4 allows users to customize the tab name
    Thank you so much!
  • @timwr820
    Thanks. I'll make this setting disabled by default in the next update.
  • @hsiangyu_wong great work and thanks for fixing the memory issue. Is there a way to preview the highlights on the file as well?
  • @burgarth
    I’ll try. This may cause the preview to be slower though.
  • v0.0.6 now supports preview in dark mode. Go to Edit->Prefs->Preview and check the 'Dark Mode' to enable it.
  • edited July 16, 2022
    This is terrific. Thanks very much for your efforts. I was going to suggest a different label, but then saw it was customizable in the Prefs. Thanks!
  • @bentle Please go to Edit->Prefs->Preview and you can edit the lable
  • edited August 8, 2022
    Dear hsiangyu_wong
    Thank you very much for this great add-on as the covers image was one feature I was missing compared to citavi but now this is much more better with more options and control. Having the cover images may seem trivial but it gives better familiarity with the references. Your add-on is much better as it provides preview of first pages with ToC.
    Thanks again for all your efforts as well as Zotero's Main team great efforts.
  • Hi everyone, Hi hsiangyu_wong

    A quick feedback after downloading the plugin today :
    - it's super nice! Thank you and congrats for all the work!
    - I would upvote the cover suggestion for books when possible
    - I would also love to see a preview for html snapshots ; and images (png etc.)

    Thanks again
  • edited August 10, 2022
    Maybe an humble suggestion : to be able to add 1 to the 10 (etc.) last pages of a document, as it may correspond to the index, the summary and/or the bibliography in peered review formatted items (and books...).

    Edit after hsiangyu_wong answered below :
    Amazing! I didn't see the advanced config. Thanks!
  • Thank you all for the like!

    Supports python-style slice commands to control the previewed pages. For the first 10 and last 10 pages, please use:

    See the link blow for more information:
  • @hsiangyu_wong
    Thank you for the latest Release 0.2.8 fixing the page index bug.

    I have noticed a few issues:
    1) The default setting seems to be to fit the width of the PDF file to the width of the Preview pane. However, when you resize the width of the pane, the width of the preview is not adjusted accordingly. I think that it would be good to refresh the preview to adjust to the pane width when it is changed.
    2) The preview for a PDF file with 2 pages merged into a wide page crops a fraction of the page instead of fitting the width. Here is an example: "Perturbation Methods in Fluid Mechanics" from https://sites.google.com/site/parabolicpress/home
    3) If I collapse the "Item Pane" by drag and drop, and then expand it again by clicking on the arrows bar, I have noticed a range of strange behaviours after expanding. Sometimes I see two horizontal scrolling bars on top of each other. Sometimes the information in the Info pane also moves horizontally when moving the horizontal scroll bar.
  • My workflow benefits best from spacebar activated popup windows with the preview of the pdf -- like the very very popular QuickLook addon that has recently lost development support in the newest version of Zotero. Can spacebar popup preview be implemented?
  • @damonturney
    Could you please describe why pressing space to preview is a must? Selecting to preview is more convenient than selecting and pressing space to preview.
  • edited August 16, 2022
    Hsiangyu, with much/great respect and gratitude for what you've already built, the reasons for spacebar-activated-pop-up preview are the same ones that motivated Apple engineers to instigate it in all their OSX for many years now:

    1) it makes better use of column space, because instead of previewing the pdf in a skinny column you instead see the pdf preview in a larger "whole screen" view that is more readable in size, thus saving column space for normal uses and not forcing the user to resize their right-hand-column into an unnecessarily large column width.

    2) it eliminates unnecessary previews of files the user doesn't actually want to preview. As the user clicks/arrow-ups-downs through many papers they usually don't want to preview each one of them. Only sporadically do they want to preview a paper, and with spacebar they can sporadically instigate a preview -- only when needed.

    3) it's faster/easier keyboard work to press spacebar than it is to scroll the mouse over to the preview tab and click, then sometimes resize the column to make it readable.
Sign In or Register to comment.