ZotFile - Advanced PDF management for Zotero

  • Hmm, that's odd. What version of Zotero, Iceweasel, ZotFile are you using? (I was using Zotero Standalone 4.0.22 with ZotFile 3.1 in my screenshots btw)

    Can you submit a Debug log for saving an item with a PDF? Also, if you right-click the attachment -> Manage Attachments -> Rename Attachments, does ZotFile move/rename the item?
  • (aurimas - the video plays for you? I get an error)
  • (yup. plays fine in Chrome. It's just an mp4 file, so maybe try saving it first?)
  • Got it now. Definitely not a linux issue. This works fine on Ubuntu (as well as Mac OS, which is what Joscha uses). It's certainly possible it's an Iceweasel issue.
    In addition to the questions aurimas has, testing in Zotero Standalone would be quite interesting.
  • Thanks for your answers. Here are some informations asked.

    1. Versions

    Iceweasel 32.0.3
    Zotero 4.0.22
    Zotfile 3.1

    2. I recorded the log corresponding to the action of saving a item with a pdf (exactly the same action I did on the screencast). The Debug ID is D1782313090. The big message in French is about encoding (utf8).

    3. I did try Zotero standalone with the same zotfile settings: I was unable to register the pdf at all. The debug ID of this action with zotero standalone is D1501544986.

    P-S: I use Debug ID but I have no idea where the code is send. How can I see my own log with the Debug ID?
  • I use Debug ID but I have no idea where the code is send. How can I see my own log with the Debug ID?
    It's sent to zotero.org and only Dan and Simon can see the contents. We'll have to wait for them to come around. You can see your Debug log by clicking "View Output" instead of "Submit to Zotero Server" (or click both)
  • 2. I recorded the log corresponding to the action of saving a item with a pdf (exactly the same action I did on the screencast). The Debug ID is D1782313090.
    [JavaScript Error: "[Exception... "Component not initialized"
    nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"
    location: "JS frame :: chrome://zotfile/content/zotfile.js ::
    Zotero.ZotFile.autoRename.notify :: line 467" data: no]"
    {file: "chrome://zotero/content/xpcom/notifier.js" line: 165}]
  • pprw: I can't reproduce that error on my system so it's hard to fix. Can you reproduce on a different computer?

    Update about extraction of annotations in zotfile

    Annotation extraction has made great progress over the last versions. I am now using a testing framework to ensure that changes do not break other files (which happened in the past). Here is an overview of the improvements for different zotfile versions. Most of my own files just work. These are some of the problematic files I collected over time.The difference between 90% and 100% is big(!). A lot of wrong word segmentation with misplaced or missing spaces. Below is an example. The main improvements are coming from more recent pdf.js versions that support more pdf standards (e.g. test-1.pdf and many other files) and improvements in the extraction algorithms mainly for word segmentation (e.g. Imbens-2004.pdf). Zotfile is still not working well with pdfs that screw up the order of characters (Connell-2005.pdf, Sanders-2002.pdf). They are generally older and I don't encounter them very often.

    Comparison of Zotfile versions

    Here is an example:

    Copy & paste from Preview on Mac (88.25% correct):
    "Recentlytherehasbeenasurgeineconometricworkfocusing onestimatingaveragetreatmenetffectsundervarioussetsofassumptions. Onestrandof thisliteraturheasdevelopedmethodsforestimatingaverage treatmenteffects for a binarytreatmentunderassumptionsvariously describedas exogeneity,unconfoundednesso,r selectionon observables"

    Zotfile 3.1 (95.55% correct):
    "Recently there has been a surge n econometricwork focusing on estimatingaveragetreatmenteffects undervarioussets of assumptions. One strandof this literaturehas developedmethodsfor estimatingaverage treatmenteffects for a binary treatmentunder assumptionsvariously describedas exogeneity,unconfoundedness,r selection on observable"

    Zotfile 4.1b (98.78% correct):
    "Recently there has been a surge n econometric work focusing on estimating average treatment effects under various sets of assumptions. One strand of this literature has developed methods for estimating average treatment effects for a binary treatment under assumptions variously described as exogeneity, unconfoundedness, or selection on observable"

    How you can help

    More test cases are always good. If you have a file that is not working properly, upload it somewhere and share the link here on the forum. Or join the zotfile zotero group and upload files to the group. Please include the correct text for annotations in json format. "markup" is the highlighted text and "content" are notes. Here is an example for a pdf with three annotations (2x highlighted text and one note):

    "markup": "Recently there has been a surge in econometric work...",
    "content": ""

    "markup": "The implication of these assumptions is that...",
    "content": ""
    "markup": "",
    "content": "This is a note."
  • Here is a update about my problem:

    Remind: On my Debian computer with iceweasel, Zotfile isn't moving and renaming attachments (pdfs) even if the settings say to do so. Instead, the attachments are send to zotero cloud and not renamed.

    I tried with another computer with the exact same zotfile settings and with the same zotero account. This computer is using ubuntu (so firefox and not iceweasel) and zotfile is working as expected (attachments are moved and renamed).

    So there are two possibilities:
    1. There is a bug with zotfile and Iceweasel. Maybe zotfile calls firefox instead of iceweasel when moving and renaming file. Here is the debug log when I add an entry with pdf from the url bar icon with iceweasel : http://pastebin.de/142984

    2. Javascript is not working properly on Debian unstable or I have so package needed not installed.
  • P-S : on the same debian computer, when using zotero-standalone no pdf are added as attachments.
  • Sorry, pprw, I won't have time to debug this anytime soon. It's also pretty hard without access a running system with Iceweasel.
  • Hello,

    I've encountered a problem that seems to be related to Zotfile.

    I've got two machines with Zotero
    - Laptop with Ubuntu 14.04 and Firefox 33.0
    - Laptop with OSX Yosemite and Firefox 32.0.3

    On both machines, I've tried installing Zotile 3.1 and 4.0 (at different times). On both machines, I've taken these steps to make use of Zotfiles "send to tablet" function:

    1. Installing Zotfile
    2. Zotfile Preferences --> Tablet Settings --> Use Zotfile to send and get files from tablet --> (setting directory to .../Dropbox/Zotfile)
    3. Selecting an arbitrary Zotero entry with a PDF
    4. Right-click (CTRL-click) Manage Attachments --> Send to tablet

    As intended, this results in a PDF copied to the .../Dropbox/Zotfile location. But upon next Zotero sync, I get a brief error that looks like this:

    Component returned failure code: 0x80520008 (NS_ERROR_FILE_ALREADY_EXISTS) [nsIFile.create]

    And the file syncing error appears to affect Zotero sync on the other laptop, even if Zotfile has not been installed. I've submitted the complete error report as issue 563331324.

    Since I've encountered this error several times, I've decided to remove Zotfile from both machines, delete all local Zotero data, and start from scracth by reinstalling Zotero. The errors are no longer being reported at this point.

    I would like some help identifying the source of the problem as Zotfile really seems like a viable solution to a problem I have: syncing PDFs to my Android tablet. What steps could I take after installing Zotfile to eliminate this problem? Are there conditions in my own Zotero database that might contribute to this? Any guidance in troubleshooting this would be welcome.


  • Which version of zotfile are you using? Can you try with the most recent zotfile version on github: https://github.com/jlegewie/zotfile/releases
    Make sure that syncing works before you send a file to the tablet.
  • @Joscha, I've tried both 3.1 (from the FF add-ons) and 4.0 (downloaded today, November 2, 2014) from Github.

    I'll trying reinstalling 4.0 as you suggest and then confirm that syncing to Zotero data storage works before sending any files to tablet.
  • @Joscha,

    I just installed 4.0 from Github. Immediately after installing and enabling, I restarted FF and synced Zotero without any trouble. Then I went to Zotfile preferences and chose the option for "send to tablet". I tried syncing again without any trouble. Next, I chose an arbitrary PDF file and tried to send it. I was able to do this successfully.

    However, when I tried syncing again, I got this error:

    [JavaScript Error: "[Exception... "Component returned failure code: 0x80520008 (NS_ERROR_FILE_ALREADY_EXISTS) [nsIFile.create]" nsresult: "0x80520008 (NS_ERROR_FILE_ALREADY_EXISTS)" location: "JS frame :: chrome://zotero/content/xpcom/file.js :: Zotero.File</this.createShortened :: line 326" data: no]" {file: "chrome://zotero/content/xpcom/file.js" line: 657}]
    [JavaScript Error: "[Exception... "Component returned failure code: 0x80520008 (NS_ERROR_FILE_ALREADY_EXISTS) [nsIFile.create]" nsresult: "0x80520008 (NS_ERROR_FILE_ALREADY_EXISTS)" location: "JS frame :: chrome://zotero/content/xpcom/file.js :: Zotero.File</this.createShortened :: line 326" data: no]" {file: "chrome://zotero/content/xpcom/sync.js" line: 586}]

    version =>, platform => MacIntel, oscpu => Intel Mac OS X 10.10, locale => en-US, appName => Firefox, appVersion => 33.0.2, extensions => LastPass (3.1.1, extension), 1Password (4.2.4, extension), LibX (2.0.15861.0, extension), ZotFile (4.0, extension), OpenH264 Video Codec provided by Cisco Systems, Inc. (1.1, plugin), Shockwave Flash (, plugin), AdobeAAMDetect (AdobeAAMDetect, plugin, disabled), QuickTime Plug-in 7.7.3 (7.7.3, plugin, disabled), Default Browser Helper (600, plugin, disabled)

    Any advice on what I can try next?
  • Mmmh, no idea why that happens. Can you still open the attachment by double-clicking on it? Are you using "background mode" (.tablet.mode setting)? You probably are, if you have no idea what I am talking about.

    Dan, are there any additional information in the error report (563331324)?
  • @Joscha,

    Yes, I can open the attachment by double-clicking it.

    And yes, I have no idea how to tell whether I'm running in "background mode" or not. It sounds like that's something I would need to manually change somehow; I haven't done so.

    Also, if it helps, I obtained the debug output logging for the last manual Zotero sync I invoked. The complete output is posted at the link below.


    Thanks for your help!

  • Can you try a few FF profile with the article below? Here are the steps (note that this keeps your main profile and data intact):

    1) Create a new FF profile and start FF with that profile
    2) Install Zotero
    3) Install Zotfile 4
    4) Enable Zotfile's tablet feature
    5) Capture this article with Zotero (download pdf manually if it doesn't get added automatically)
    6) Set up a new Zotero account for testing
    7) Sync
    8) Send pdf to tablet
    9) Sync again
  • @Joscha,

    I followed your steps precisely. The one exception was that I when I took step #8 (Send PDF to tablet) for the first time, no PDF was actually written to the location. I went on to step #9 anyway--it was successful. Then I repeated steps #8 and #9 again. No problems.

    It's encouraging that this works with a very simple example.

    What steps would you recommend for me to troubleshoot my issue?

    Thanks so much for your continued assistance.

  • So it worked with this setup, correct? It's hard for me to establish what the problem is. The best you can do is try to change things in this test library to make it look more and more like your main library. Keep trying "send to tablet" and sync to see when the problem emerges. Change the settings so that they are the same as in your main profile. Add the reference you had problems with. Import all references from your main library etc etc.
  • I love love love ZotFile's annotation extraction. I was previously using macro software and CLI software to get PDF annotations → FDF file → Zotero, so this saves a lot of clicks. I'm also really happy with the hidden formatting options you've added, which have made it almost a 100% replacement for my old workflow.

    I say 'almost' because ZotFile takes all of my annotations and lumps them into a single note, while I prefer each one to be separate since each annotation is an atomic part of the paper. I don't want/need to annotate in multiple colors, so I can't use the colorNotes option. It would be great if there was an option to just make a new note for every new annotation.
  • That's actually strongly discouraged (and I think we may even have asked Joscha to change it) since huge numbers of notes will slow down Zotero and affect syncing.
    If you have a moderately sized library with 1000 items, each with 100-200 notes, Zotero will become all but unusable.
  • edited November 8, 2014
    Oh wow, I'm not talking hundreds of notes per item, I keep just 1–20! I have 700+ items right now, over 20% of them have notes, I sync to a webdav server, and everything's peachy.

    Even if one-note-per-annotation is a hidden option that's off by default, I would be very grateful to have it because I would be able to work with ZotFile using the workflow I'm accustomed to.
  • I was trying to install Zotfile on an Android tablet, unfortunately without luck. The attempt to install the plugin results in the following error: "ZotFile could not be installed because it's not compatible with Firefox 33" I tried it with Firefox Beta 34.0 as well and same thing there.
  • Firefox for Android is entirely different software from regular Firefox--you can't install Zotero there (nor ZotFile, though without Zotero that doesn't do anything anyway).
  • Ok, but how's then ZotFile supposed to be used on an Android device?
  • It's not directly, you use ZotFile on your computer to send file attachments to a Dropbox folder (or whatever else you want to use to sync) that can then be accessed on your tablet. It can then be used again on the computer to retrieve the file and update it with any modifications you made on the tablet.
  • (for more details see www.zotfile.com)
  • After another failed attempt to get mozilla approval for Zotfile 4.0, version 4.1 is now under review. I hope it get's approval this time! The version is also available from github: https://github.com/jlegewie/zotfile/releases

    It would be great if some people can download this version and report any problems (or lack of problems)!
  • Is there a way to select all PDFs in Zotero (I'm using standalone) and then use Zotfile to extract all annotations? I've tried selecting all items in Zotero and right-clicking > Manage Attachments > Extract Annotations, but this seems to select only the items and not the PDFs attached to the items, which means annotations are not being extracted from the PDFs.

    Basically, I'm looking for a way to keep my annotations in sync as searchable notes in Zotero without having to remember which PDFs I've annotated and select each one individually for extraction with Zotfile.
This discussion has been closed.