ZotFile - Advanced PDF management for Zotero

  • edited March 22, 2013
    Pushing and Pulling files to the Tablet via Dropbox doesn´t work any more (Windows 7, Zotfile 2.3.1, Zotero 3.0.14) generating:

    TypeError: file.exists is not a function
    (chrome://zotfile/content/zotfile.js, 1416)
  • Hi Joscha,

    Amazing work with ZotFile, well done!

    Is it possible to have ZotFile move pdf's to subfolders that mirror the organisation inside zotero? For example if the citation is stored in My Library->Articles->Fish then is it possible to have ZotFile move the pdf for that citation into My Custom Zotero PDF folder->Articles->Fish?

    Thanks very much for he hard work. I've been recommending Zotero to everyone I know and I never forget to include ZotFiles functionality in those recommendations! Everyone I speak to is instantly interested in Zotero + the functionality added by ZotFile :)
  • Zotfile 2.3.2 is under review, which is compatible with Zotero 4. There will some other additions in the future to work with zotfile and colored tags.

    dorvak, I can't reproduce this error. Everything works for me.

    Tsau017, there is something like this for tablet files but it doesn't really work in general because zotero items can be in multiple collections.
  • Hi Josh,

    Sorry I didn't get a chance to respond before, but thank you so much for fixing the earlier bug!

    Now I have a new issue...

    I downloaded Zotero Standalone 3.0.14 and when I tried to add Zotfile, I get an error message stating that zotfile isn't compatible with this version of zotero. Has this happened to anyone else?
  • sorry for that. It should work now.
  • Joscha

    First, thank you for a wonderful program which makes Zotero about twice as useful as it would otherwise be to me. The combination of cloud syncing stuff to a tablet and extracting annotations to notes is so exactly what I need ...

    However, I have a PDF page which reliably and repeatedly crashes firefox when I try to extract the annotations in it with zotfile.

    This is using
    Firefox 19.02 on Windows 7 32bit with
    Zotero 3.0.14
    Zotfile 2.3.2

    I would send you the PDF file in question but it is extremely confidential, which gives me a difficulty. It was annotated on my tablet, as part of a run of five scanned pages. The others seem to yield their annotations fine. This one has six comments, one text box, and one highlight on it. The text is simply scanned, not OCR'ed. Is it possible that highlighting text that has not been OCRed will confuse the extraction mechanism?

    In any case what happens is that Zotfile hangs while extracting, with a message to press ESC to abort the process. Firefux runs up to 50% of CPU in the task monitor. The screen goes briefly black and then recovers. There is sometimes a message about running out of memory in the firefox error log.

    I'm sorry if this is not a very helpful bug report. But I really can't let you have the scan in question. I will see if I can narrow it down using other ways to scan to PDF

  • Hi Joscha,

    Once again thank you for your amazing work!

    Sad news - Zotfile has been disabled as I have Zotero version However, I can't seem to download the new version 2.3.3 from the Firefox add-ons page. I can't seem to download -any- version. I've tried using Chrome and Firefox as browsers, right-clicking and "save links as", nothing works. I click on "continue to download" and it takes me to the "meet the zotfile developer" page. I've checked and there's no download or pop-up blocker.

    Any ideas?

    Many thanks!
  • A slightly improved bug report. It appears that this hang in Zotfile happens when it is asked to extract annotations from a file which has highlights in it, but has not been OCRed.

    This is true even if you put the highlights into a PDF and subsequently OCR it (and then resave it with the OCR text as a new payer).

    I now have a non-confidential file which might show this behaviour (I say this because I deleted the troublesome highlight and now can't recreate it.)
  • Zotfile has been disabled using Standalone for Safari. Any idea when this will be fixed?
  • The compatibility bug was in 2.3.2, which I deleted. You can either revert to 2.3.1 (compatible with Zotero 3.x) or update to 2.3.3 (compatible both with Zotero 3 and 4).

    2.3.3 is still under review at mozilla but you can download it from here.
  • Joscha

    I am using Zotfile 2.3.3 with Zotero 4.0.2 on XP, Firefox 20. When I try to extract annotations from a PDF nothing happens (just the message "Extract PDF annotations..."). I looked at the Firefox error console and Zotfile is throwing the following error:
    Error: SyntaxError: missing ( after for
    Source File: chrome://zotfile/content/pdfextract/extract.js
    Line: 60, Column: 14
    Source Code: for each (var annot in annots) {

  • Thanks for that catch, mc. I think this was a change in FF 20. It's now fixed in 2.3.4, which is under review and you can already download it here here.
  • edited April 6, 2013
    I had the same problem with extracting the annotations. After I installed zotfile 2.3.4 it works for some pdfs but on the rest firefox gets to use all the memory...
    I downgraded firefox to version 19.0.2 and zotfile to v.2.3.1 so everything works like before.
  • Question for users and/or Joscha:

    Is it possible to use the conditional renaming rules to do the following:

    Item Type [%T] = Letter
    Then File name = {%F} {%y} [Recipient's Name]

    E.G. John Smith to John Doe, December 1, 1900 would output as
    "Smith 1900 Doe"

    Thus, I am asking whether there is a way to use any of the exiting wildcards in this way. I am pretty sure the answer is no, so I am also wondering if anyone else has come across this issue/question.

    I ask only because when I rename multiple letters by the same author (letters most often do not have a title), I end up with files named things like "Smith 194713" (indicating it's the 13th letter from that year sent by the author).

    If anyone has any ideas how to deal with this issue, I would love to hear them.
  • edited April 8, 2013
    (Edited this post since I updated to Zotfile 2.3.4 and the error message & debug ID is different now.)

    PDF extraction still does not work for me, I'm using Ubuntu 12.10, Firefox 19.0.2, Zotero 4.0.3 and Zotfile 2.3.4.

    When I try to extract annotations, the progress bar just flashes on the screen for a fraction of a second, and nothing else happens. I've done the annotations on an Android app (EzPDF Reader), and they work fine with Adobe Reader, so I'm guessing they're pretty standard.

    Debug ID is D452364217, here is the top of the debug log:

    [JavaScript Error: "this.docShell is null" {file: "chrome://global/content/bindings/browser.xml" line: 323}]

    [JavaScript Error: "gBrowser.addProgressListener was called with a second argument, which is not supported. See bug 608628." {file: "chrome://browser/content/tabbrowser.xml" line: 1980}]

    [JavaScript Error: "this.docShell is null" {file: "chrome://global/content/bindings/browser.xml" line: 323}]

    version => 4.0.3, platform => Linux x86_64, oscpu => Linux x86_64, locale => en-US, appName => Firefox, appVersion => 19.0.2
  • see Joscha's posts above - upgrade to Zotfile 2.3.4 for Zotero 4.0 compatibility.
  • Thanks @adamsmith, sorry, I was sloppy skimming through the posts. I updated Zotfile now to 2.3.3, but unfortunately still no luck... The error messages changed though. I edited the post above to reflect the changes.
  • you should install 2.3.4
  • @adamsmith, I actually did... Sorry, this is not my best day.
  • did this work for you before? I have extraction working on Linux 64 bit - though with FF 20 - doubt that makes a difference, though.
  • I've never gotten the extraction to work, however, read on:

    I tried with a random annotated PDF found by googling, and the process just hangs with the "unresponsive script" errors:


    However, I tried a PDF annotated with iPad's iAnnotate, and it worked!

    I also made a super-simple PDF, added annotations with EzPDF reader, and tried extracting. Does not work, similar behaviour as in my previous post. The test-PDF is here:


    So, should I file a bug with pdf.js? I don't think I'll get a lot response from EzPDF reader, since their annotations work with other software...
  • OK, that's the same behavior I'm getting.
    I have tried extraction with pdfXchange and adobe pro and both worked fine. It does seem EzPDF is doing something somewhat non-standard.

    pdf.js is, of course, principally a pdf display tool - so you should report what it's not able to display (though I think they're pretty well aware of that) rather than what it's not able to extract. You can try, but I wouldn't expect anything to happen quickly.
  • ZotFile uses an old version of pdf.js
    If you can reproduce your issue with an up-to-date version of pdf.js, you should report it. E.g, if the extraction does not work in ZotFile, you can try to copy&paste the text with pdf.js: if it does not work or gives strange results, report it (but as adamsmith wrote, they're probably aware of these kind of general issues).
  • Hi all again.

    The only combination that works for me for annotation extraction is:
    -firefox 19.0.2
    -zotero 4.0.3
    -zotfile 2.3.1
  • hwileniu, both pdfs work with the poppler-based extraction tool. As Gracile pointed out, the version of pdf.js used by zotfile is outdated. I won't get into updating it, which is more work than just replacing the files with the most recent version. This would really be something for which I could use some help!

    epimachos, make sure that the same pdf works in FF 19.0.2 with zotfile 2.3.1 but not in 2.3.4. If that is the case, I might be able to fix it if you provide more information (error message etc).
  • Ok, I tried replacing the pdf.js from the github repository. Still no luck, except now I get a nice error message: "Zotfile was unable to extract...". Too bad, I really like the extraction feature! Maybe I'll go nag the EzPDF developers. I'm still not sure though how to report the problem to them. I tried looking at my pdfs with the pdf.js that ships with FF19, and the notes are visible, but the highlights are not. And there seems to be no way to copy the note text to clipboard!
  • edited April 9, 2013
    I just responded to the auto-update to upgrade Zotero, and now it says that my ZotFile addon is incompatible. Any ideas?

    Edit: Zotero 4.0.4, Zotfile 2.3.1

    (Sorry if this is the wrong thread!)
  • edited April 9, 2013
    right thread - see about 10 messages up by Joscha - includes link to Zotfile 2.3.4, compatible with Zotero 4.0
  • Thanks, sorry for my scroll impairment :)
  • Pushing und pulling files to the Dropbox still doesn´t work for me, Joscha. Im am using Zotero 4.0.4 Standalone and Zotfile 2.3.3. under Windows 7 (no problems on my mac), Chrome is the Standard-Browser, JS is activated.

    Same error message:
    TypeError: file.exists is not a function
    (chrome://zotfile/content/zotfile.js, 1416)

    Can i delete and reinstall the Zotfile-files manually?
This discussion has been closed.