ZotFile - Advanced PDF management for Zotero

  • Joscha,
    ZotFile is a great tool, congratulations.
    However, since I updated to Zotero 4.0 and ZotFile 2.3.5 (Windows 8 and Firefox 20) an error occurs.
    The "extract annotations" acts in a strange way, replacing characters in the extracted text. For instance:
    This text "In these early days, historians had to rely on general purpose software" is extracted as "*OUIFTFFBSMZEBZTIJTUPSJBOTIBEUPSFMZPOHFOFSBMQVSQPTFTPGUXBSF".
    Everything works well in note's extraction.
  • kguimond, I need a reproducible error together with an error message... Look at the zotfile webpage for details

    springgao, this has nothing to do with zotfile. It is the way in which linked attachments in Zotero work. /Users/[myname]/Desktop/Zotero attachments/file.pdf is just not a valid location on windows.

    DanielAlves, are you talking about the exactly the same pdf file? So did the old version extract a specific file correctly but the new one does not? Otherwise, it's simply the pdf file that does not work. If you can not copy-paste selected text from the file, zotfile will never be able to exact highlighted text. If you can copy-paste text, there is a chance that the next version of zotfile solves the problem.
  • springgao - you should be able to address this with relative paths in Zotero, though.
  • I have started a new thread for the Zotfile 3.0 beta. Please use that thread for any comments about the beta.
  • Hello Joscha,
    Thanks so much for your help! Zotfile is really helpful for my workflow.

    I usually use zotero standalone, but the same things happens from within Firefox (and generates an error). The following errors come up on the console every time I try to rename an attachment (the 4 errors are for one attempt):

    Timestamp: 5/9/13 10:36:14 AM
    Error: TypeError: Zotero.ZotFile is undefined
    Source File: chrome://zotfile/content/zotfile.js
    Line: 672

    Timestamp: 5/9/13 10:36:15 AM
    Error: TypeError: Zotero.ZotFile is undefined
    Source File: chrome://browser/content/browser.xul
    Line: 1

    Timestamp: 5/9/13 10:36:15 AM
    Error: TypeError: Zotero.ZotFile is undefined
    Source File: chrome://zotfile/content/zotfile.js
    Line: 672

    Timestamp: 5/9/13 10:36:16 AM
    Error: TypeError: Zotero.ZotFile is undefined
    Source File: chrome://browser/content/browser.xul
    Line: 1

  • Thanks, that is a proper bug report. I still can't reproduce it though and it doesn't really make sense to me. So you should try to a) reinstall zotfile, b) try with a fresh Firefox profile (https://developer.mozilla.org/en-US/docs/Mozilla/Multiple_Firefox_Profiles), c) try the 3.0 beta.
  • edited May 21, 2013
    Hi Joscha,

    Thanks for making something that looks potentially awesome. I am not sure if this is a "bug" or if I messed up the set-up. I've managed to "Send Files to Tablet" with no problem. However, after I annotated the file on iAnnotate, re-synced with DropBox, I can't seem to "Get File from Tablet" on Zotero. It's greyed out. From my understanding, the annotations are supposed to come back as a note. No such luck.

    I've selected as my "Source Folder" the same DropBox folder I use for my "Tablet Folder". Could this be the problem?

    I am running Zotero Standalone 4.0.8, & Zotfile 2.3.5

    Thanks for your help,


    P.S. Would love to join the beta-testers for version 3.0,
  • I can't really do anything without a proper error report (reproducible steps with error message)...

    Zotfile 3.0 is now under review and can be downloaded here.

    - Improved extraction of annotation
    - Goto annotation in pdf
    - Tablet feature: Restrict saved search for tablet files to sub-folders
    - Tablet feature: Support of colored tags in Zotero 4
    - Italian localization (thanks to Roberto Caviglia)
    - Remove empty sub-folders when getting files from tablet
    - Fix alert window (headline was missing in Zotero 4)
    - Fix automatic renaming option "Only ask if..."
    - Fix for zotfile item menu on Zotero as a tab

    For more details see here.
  • Hi Joscha. I wanted to ask if Zotfile could change the "date modified" field of the parent item when it extracts annotations? Currently, the annotations extracted as a note have today's date but the parent item appears not to have been modified in the past month. This makes it harder for me to sort to find my recently annotated files!

    Looking forward to trying out Zotfile 3.0!
  • It's up to Joscha, but I'd be weary of updating the date modified field when an item isn't actually modified (the note is separate).
    It would be pretty easy to set up a saved search that displays all items with notes from Zotfile extraction from the last week (or any other randome time-frame).
  • Ah, okay, that makes sense.

    In which case, it's a broader Zotero question. I want to see my files in a sub-collection sorted by the date by which I last added/modified a note. There is a way to sort by the number of notes, but not by date of the notes. I'll look to see if I can do this some other way and pose the question to the general forum otherwise.
  • A saved search like that is actually a nice idea. I just added it to my own library. Here are the criteria:

    1) Note contains "Extracted Annotations (" (without the quotation marks)
    2) Date Modified is in the last X days

    That is all. I also checked "include parent and child items of matching items".
  • Several difficulties to report. I am a new user, and hopeful they are easily solvable. Here is my setup:

    Zotero 4.0.8
    Zotfile 2.3.5
    Firefox 21.0 (Firefox for Ubuntu; canonical - 1.0)
    Linux: Kubuntu 13.04
    iAnnotate, latest version (iPad)

    PDFs seem to "send to tablet" and "get from tablet" fine (as far as I can tell). However, "extract annotations" seems to do nothing, after the PDF has been "gotten" from the tablet/iAnnotate. Also, the modified file can no longer be opened in my external reader (presently, none of my Zotero PDFs can be opened in the internal FF viewer, but all of the rest can be opened in my external viewer). I'm sure I will have more to say as I tinker, but that is all for now? Is there something I could be doing wrong?
  • Also, the modified file can no longer be opened in my external reader (presently, none of my Zotero PDFs can be opened in the internal FF viewer, but all of the rest can be opened in my external viewer).
    I think it's related to: https://forums.zotero.org/discussion/29559/cannot-view-pdf-attachment-in-firefox/#Item_2
  • Great! That seemed to have fixed my problem. I believe the few items I was having the most serious trouble with just somehow got corrupted. Everything seems to work fine now! Thanks!

    Now for a couple of questions. I'm trying to understand how Zotfile works as I begin using it, as I plan for Zotfile/Zotero to be my bibliographic and organizational mainstay from here on out. What, if any, is the relationship between "Location of Files" in ZotFile's General Settings and "Linked Attachment Base Directory" or "Data Directory Location" in Zotero's advanced preferences. How do these all need to "jive"? I would like my attachments kept organized in a certain accessible place while still maintaining the ability to sync them with Zotero's servers. How would these things need set up in order to accomplish this?
  • Read http://www.zotero.org/support/attaching_files#file_copies_and_links and Relative Linked Attachment Filepaths (scroll down)and also http://www.columbia.edu/~jpl2136/zotfile.html
    I would like my attachments kept organized in a certain accessible place
    What do you mean exactly ? Anyway, I'd quote adamsmith on this question:
    while Zotero directly doesn't do that, your operating system does. Read up on "virtual folders" and you can very easily get all Zotero attachments in a single folder.
  • edited June 18, 2013
    Hi Joscha,

    I would like to report a bug (at least in my case): when zotfile gets back files from a folder (sub-folder in "documents", shared with a tablet) it does NOT delete the folders and sub-folders created during the "send to tablet" process.
    O.S.: Windows 7 Ultimate SP1
    Zotero Standalone 4.0.8
    Zotfile 3.0

    this batch command works fine for me (if it can help you):

    @echo off
    dir /ad /b /s "C:\Users\xxx\Desktop\Dropbox\Article Tablet From zotero" |sort /r >tmp.tmp
    for /f "delims=" %%a in (tmp.tmp) do rd "%%a" 2>nul
    del tmp.tmp

    Thank you for your Job!

    Another bug has been found, although it looks like an old one:


    Everytime I try to export a note and import in Evernote, Evernote shows the note with title "Undefined" and empty body. To be honest, I tried to add a note from Zotero "add note" command as well and I got the same problem; so I don't know if the issue is still related to Zotfile or to the Zotero script

  • edited June 11, 2013
    Hi Joscha,
    I was thinking about a function that could be implemented in your add-on; what do you think about an automatic "send to tablet" function?

    This is my scenario:
    I download several articles during my literature search, and they have different importance for me(based on the idea I get from abstracts); so what I am doing is To tag them like "TO READ: IMPORTANT" and "TO READ LATER" (I am using as well the colour code just implemented, so I can press just 1 or 2 to add these tags :P). After that, I created 2 "SAVED search" based on TAGS so I can collect them in 2 different virtual places and I can send them to the tablet with your addon.

    Now, here comes the IDEA:
    Zotfile COULD (if desired) search every X time (defined by user) in the collection for a TAG or more TAGS (I dont know if this could arise some program issue)DEFINED by user (in my case: search for "TO READ: IMPORTANT" and "TO READ LATER") and send them automatically to the main folder already defined in the option (i.e. the folder shared with dropbox), using as MAIN Subfolder the TAG and as sub-subfolders the ones already defined in options (i.e.\y\w\a).

    What do you think?

  • There seems to be a bug in the way that the author truncation in the renaming function works.

    Zotero Standalone 4.0.8
    Zotfile 3.0
    No error message.

    The desired behavior is for a maximum of three authors to be used in the file name. If an item has four or more authors, then the first three will be displayed, while the rest are truncated. The current behavior of the renaming function is to truncate down to only one author and then add the specified suffix (default to "et al"). This doesn't seem like it is intended to work this way. I would expect that the intention is to display the number of names specified in the "Maximum number of authors" option. Is this expectation incorrect? Could the extension be modified to correct this behavior?

    Many thanks,
  • Is there a straightforward way to add additional field code mappings to the zotfile renaming function? I'd like to use the first page number in the file name, rather than both page numbers.
  • Hi,
    I would like to report that the links (the ones that zotfile plugin adds at the end of every paragraph extracted from pdf notes) in the generated reports do NOT work. I tried to open them from HTML page opened with Chrome (with zotero addon) and Firefox.

    O.S.: Windows 7 Ultimate SP1
    Zotero Standalone 4.0.8
    Zotfile 3.0
  • they only work on mac and linux at the moment. Getting them to work on Windows would require someone knowledgeable about pdf handling in windows to help out.
  • I see! Ok Thank you adam, I hope someone will help you.

  • (help Joscha - I just know this because I helped with some testing and some code suggestions for the Linux version, I have nothing to do with Zotfile coding otherwise)
  • Could someone be kind enough to tell me (before I try it out) what the %I option does? If the author's name is John A Doe, does %I yield JAD or just JA? If former, is there a way to get only JA? Thanks!
  • edited June 22, 2013
    is it normal it took ~2 min by item to rename them? Sometimes it freeze so much that I have to forceclose. And occasionaly, it took so much CPU that zotero just crash. But I can't predict which item will stop and keeps freezing. It's more a feeling, but I think it get more difficulties to remove the pdf than create the link, as when it crashes, I get a pdf (with circle-so not there) + link (fine-it's there).

    On standalone 4.0.8; zotfile 3.0; Ubuntu 12.04
    Librairy : 1540 items with each one link to file. No indexing. No syncing.
    Strangely, I get nothing on debug windows even if it have thousands of lines registered.

    PS Edit: Forget it. I didn't remember I tried another addon "AutoZotbibExport". I deactivate it and it come back to normal.
  • Hi,
    I thought there was an option only to rename files, but as far as I see, the option also moves the file. Is it a removed feature?

  • This feature is still there. Simply don't specify a folder to move the attachments to and zotfile will rename them in place.
  • edited July 12, 2013
    If I don't specify the folder, I get the following subsequent errors:

    "Error when moving the file '****.pdf' (Exception..."Component returned failure code:0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)[nsIFile.moveTo]"nsresult:"0x80520015(NS_ERROR_FILE_ACCESS_DENIED)'location:"JS frame::chrome://zotfile/content/zotfile.js::<TOP_LEVEL>::line 1375"data:no])."

    "'****.pdf' Attachments skipped because they are on the tablet, top-level items, snapshots or the file does not exist."

    And after that, the pdf file transforms into a link file in Zotero... and it doesn't rename itself.

    Thanks! (ps. I changed user name)
  • Are you using zotero storage/webdav, or are you also storing your files elsewhere and linking to them zotfile-style?
This discussion has been closed.