ZotFile - Advanced PDF management for Zotero

  • You mean the function where Zotfile generates the labels for extracted highlights? That's in zotfile.js, starting about here: https://github.com/jlegewie/zotfile/blob/master/chrome/content/zotfile/zotfile.js#L3401

    (The citing function in Zotero is in citeproc.js, but that's not really relevant here).
  • What about an automatic update feature to keep all TOCs and extracted annotations up-to-date? I imagine that this could be accomplished by comparing when the pdfs were last edited with the time-points of TOC/note extractions. I think this would be an awesome feature!
  • I thought about this a little but I don't think it is feasible right now. Correct me if I am wrong, but it doesn't make sense for outlines, no? When do they change? I agree that it makes a lot of sense for annotations though. That is actually how most other programs do it (e.g. Mendeley). In Zotero, however, I save the annotations in notes that can be edited. This has the advantage that you can edit annotated text, add comments, merge them, reorder them, copy them to stand-alone notes that summarize everything about a certain topic or organize your research in other ways. You can not do that in Mendeley etc and I think it's a great advantage! The disadvantage is that I can't just update the annotations because the user can modify them and I would discard these changes. Theoretically, we could have the best of both approaches with three tabs on the right when you select a pdf attachment for 'Info' (the current one), 'Annotations', and 'Content'. The annotations tab would include an up to date list of the annotations (with links) that can not be edited + a button with something like 'create editable note from annotations'. It should be possible to do that from a plugin with some tricks and work-arounds but it's quite a mess and I don't have any plans to implement it for now.
  • You are right, TOCs/outlines normally don't change. The only exception would be after replacing a paper with a version that contains supplemental information but that's most likely very rare. So the update feature should be limited to the extracted annotations.

    I personally go a lot back and forth between papers: changing annotations, making additional comments after reading other papers, etc. so from my perspective having an updated version of my annotations would be awesome. The best-of-both-worlds approach you suggested sounds like a perfect solution to me. Together with being able to extract annotations based on color (see suggestion a couple of weeks ago) this would help me tremendously in my daily research.

    I know you probably are very busy and there is not enough time to implement all this, so I would really like to help you. I don't have much coding experience but I will try my best. I just recently learned JavaScript with the hope of being able to contribute to zotfile and zotero.
  • I played with the three tab solution a couple of month ago but it really manipulates Zotero’s user interface and I wouldn’t recommend working on it without significant experience. I am not sure myself whether I am comfortable with these manipulations in zotfile. You could play around with the color stuff. I am actually extracting the colors for the pdf but they are not used by zotfile. I guess it would be challenging with little experience but you can give it a shot. Just open a ticket on github and I can tell you something about the steps that are involved.
  • Here is a bug that I have noticed:
    Zotfile will typically not import files from the watchfolder or send them to the tablet if they are named with the extension ".PDF" in uppercase. When I change the filename extension to ".pdf" in lowercase everything works fine. This problem has been consistent over a large number of files from various sources.

    I'm running Zotero 4.0.17 with Zotfile 3.1 on a Mac.
  • I don't know if it's appropriate to place features requests, here, but if so, I'd love to see the following:
    1. The ability to send everything within a collection and it's subcollections to a tablet by right-clicking on the collection name, rather than selecting the files within the collection and then moving on to select the files in the subcollections.
    2. It would be wonderful to be able to specify separate naming and/or "send to tablet rules" for different collections. For example, in some of my collections I like to have Zotfile create a subfolder for each separate journal; for other collections, I'd like to just dump all the articles in a single folder on the tablet.

    Overall, I think Zotfile in combination with Zotero is one of the best pieces of research software out there and can't thank the developer enough.
  • ZOTFILE issue while Syncronizing with BOX.com

    im using zotfile plugin in firefox and added a folder in a box file to sync with my android phone, after going online and given permission to sync the folders in the box.com website with my windows box app, syncronizing goes well when i send the file to the phone and back to computer for the first time , but if i want to send a new modification for a second round, the same pdf from my computer, then i get a double folder with the same name on the box app in the phone. this doesnt happens with dropbox, the problem is that box is an app more convinient since u send the app to the SD card, to avoid loading ur phones memory and get worried about getting slow performance on it.
    Thanks ahead if any one knows how to fix this.

    My system is windows 7 64 bit
  • jdoe3789, I fixed the bug with capitalized file endings but it's going to take some time because I have problems with the mozilla review process. Meanwhile, you can add 'PDF' filestypes setting on the 'Advanced Setting' pane.
    I like your first feature request and have opened a ticket for it. Doesn't mean that I will add it soon but it's on the record and maybe some else helps out. Not sure about the other one. Seems overly complex. Someday, there might be an option to have different renaming settings for item types.

    crschofo, I have never used box.com and I am not sure about the problems you describe. The zotfile feature should work with anything that uses a normal file system. Maybe someone else on the forum has experience with box.com?
  • Hi,

    I am using the latest Zotfile w Zotero 4.0 standalone and FF
    under wins 8 x64, with foxit phantom pdf editor and adobe reader.

    When I use zotfile to extract annotation from the pdf file, it creat a note with links like zotero://open-pdf/0_SI34ZECM/2

    I clicked this link in attempted to open and navigate to the pdf where annotation was extracted from. However zotero did nothing but just open a blank zotero window. Both standalone and FF version have this problem. But I can open links like http:// or zotero://attachement.

    I tried change the hidden option zotfile.pdfExtraction.openPdfWin to different reader .exe and change also default reader but without luck.

    Any idea how to make that work?
    Thank you.


  • I've also tried to follow annotation links with Nuance Power PDF and Nitro Pro 9 on Windows. Neither of these work. The PDF will open, but an error reading something like "The selected file cannot be found" will display, and the PDF opens to the first page, not the annotation. Works fine in Adobe Reader and Acrobat.
  • (FWIW, Joscha codes on Mac and the handling of this in Linux is pretty straightforward, the Windows implementation was a bit shaky from the start. May still be fixable, though.)
  • Could you post a Debug log for following the open-pdf link (note, don't click submit to server at the end. Click view log, then ctrl+a to select all and copy) to http://gist.github.com and then link to it here? Do this in Firefox with Standalone closed
    I've also tried to follow annotation links with Nuance Power PDF and Nitro Pro 9 on Windows. Neither of these work.
    How exactly did you do this?
  • edited May 25, 2014
    What version are you using? The current version on mozilla (3.1), the version under review at mozilla (3.2) or the current beta from github (3.3)? Goto annotation in pdf did not work on windows before 3.2, which has been under review forever (it was rejected once) and I don't know how long it's still going to take.
  • edited May 25, 2014

    Oh it now works great with v3.3 installed, though a blank zotero window still opens together. I was not aware that v3.1 is not supporting goto annoation for win. Thank you for the information !

    Another question I have is, does zofile support watch folder with multiple level of subfolders? It would be great if it can auto import pdf from that folder and subfolders like what mendeley is doing, without prompting the user to triger a import. This is the last obstacle preventing me from switching from Mendeley to Zotero. Kindly let me know if you have some idea whether it is doable. Thank you again~!
  • The most detailed thread on a watch folder is here:
    it may be doable, but as you can see it's rather complicated and won't happen soon. (It's also, in all likelihood, not a good way to use Zotero, or, more specifically, you're losing a lot of Zotero's key strengths if you're importing PDFs rather than going through the URL bar icon).
  • going through url bar icon is one of a good way. But our team share pdf papers mainly through email and we have to download them to a folder before reading. this is the reason why auto import is so important in this case otherwise we will have to download the pdf from the email, find the url of each paper manually and go to the website again and have each of them re-download by zotero. Thanks for the link anyway.
  • edited May 25, 2014
    A possible solution in your case (if you can get everyone/most people working with Zotero) is to set up a dedicated "Transfer" group where everyone places the items they want to share with the group. In my lab, each person has an collection that is their "Inbox". When they copy files to their personal libraries, they remove the items from their collection. Every month or so, the admin goes through and deletes the items that are Unfiled (because everyone has already copied them).

    @aurimas and Joscha, I was running the latest beta of Zotfile and opening following the links to Nuance/Nitro by setting that program as the default pdf handler for the operating system. I am having a variety of computer issues at the moment, so I will let you know if the problem persists once I refresh my installation of Windows.
  • All right, so here is what is happening when I follow annotation links on Windows:

    1. I have both Acrobat and Nitro Pro installed on my computer. Nitro is set as the default PDF program in the OS (setting it as default in Firefox as well doesn't change the behavior).

    2. When I follow links in extracted annotations, the PDF opens to the annotation in Acrobat.

    3. If I set the openPdfWin preference to the path to the NitroPDF.exe, the Nitro opens, but it starts a "create pdf" process and attempts to create a new pdf from the inputted link.

    Any thoughts on what is causing the behavior in 2. or 3.?
  • edited May 30, 2014
    Your descriptions sounds like two separate issues:
    1) I am not sure what's going on. Zotfile checks the registry for the path to the default pdf viewer. I don't have access to a windows machine so I can't really test anything. If you have coding experience, the javascript function to get the path to the default viewer starts on line 3109 in zotfile.js. You can play with it in the FF Scratchpad.
    2) Does Nitro support the command line arguments to open pdfs on a certain page? The syntax is like this Acrobat.exe /A "page=2" path. Here are more details: http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf
    I know that Adobe Reader, Foxit and PDF-XChange work but I never tested Nitro.
  • @bwiernik what version of Windows?
  • Windows 8.1
  • Hi, on Mac OSX 10.9.4 running Firefox 29.0.1, Zotero and Zotfile 3.1, I have noticed that Zotfile takes a long time to move, link and rename files after they are added to my library: approximately 10-15 secs for each file freezing Firefox in the meanwhile. I am not sure whether this is normal or whether I could optimize the process.

    I have the same problem also with Zotero standalone. My Zotero Sqlite db is approximately 100mb, but the problem doesn't seem to be that since by only adding a record in the library (no PDF) the process only takes a fraction of a second.
  • edited May 31, 2014
    @bwiernik, unfortunately, I don't have Windows 8 installed anywhere at this point. If you're feeling adventurous, you can try following these steps to help debug this.
    1. Open RegEdit. Not sure about Windows 8, but typically, this has been Windows Key + R, then type in "regedit" (no quotes) and press enter.

    2. If it exists, navigate to HKEY_CLASSES_ROOT\.pdf What does it say under the "(Default)" value in the right pane?

    3. If it exists, navigate to HKEY_CLASSES_ROOT\.PDF What does it say under "(Default)"?

  • Hi,

    I'm running ZotFile 3.3 with MLZ on my Mac. It was working great for a while, but today I can't use the contextual menus to manage attachments at all. They say "warning" in multiple places, and none of the commands work (for example, I've been trying to send some of my files to tablet). When I try to rename a file, I got the following error:

    [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://zotero/content/xpcom/db.js :: Zotero.DBConnection.prototype.getStatement :: line 298" data: no] [QUERY: SELECT COUNT(*) FROM itemTags WHERE itemID=? AND type IS NOT 10000 AND tagID IN (?)] [ERROR: no such column: type]

    Any ideas? Thanks!
  • (Dan - you should also report this to Frank, since there is a good chance that this is due to MLZ specifically)
  • danepps, that can happen when I screw something up but usually the version on github should be fine. Can you try reinstalling using the current version on github? Adam might also be right...

    cptnemo, it shouldn't take that long. What might hand zotero is the fact that each change from imported -> linked or the other way makes it necessary that I remove the attachment and re-add it, which triggers Zotero to index the pdf. Unfortunately, there is no way around that right now. You can try to temporarily turn of index and see whether it runs faster.
  • Joscha, thanks. I reinstalled the latest but no change. Here's another error message I just got: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://zotero/content/xpcom/db.js :: Zotero.DBConnection.prototype.getStatement :: line 298" data: no] [QUERY: SELECT COUNT(*) FROM itemTags WHERE itemID=? AND type IS NOT 10000 AND tagID IN (?)] [ERROR: no such column: type]

    I will also post this error in a separate thread for MLZ.
  • Ah, that SQL statement is MLZ code. I'll look at it tomorrow.
  • @aurimas
    Thanks for the suggestion on the registry key. That was the issue. Nitro appears to be a little sloppy in its implementation and doesn't update the registry. It also doesn't appear to support location handlers in its command line. Thanks for the information.
This discussion has been closed.