ZotFile - Advanced PDF management for Zotero

1404143454663
  • I really like your app! This is so much useful for reading my papers on the tablet, while I am waiting for a true app on Android.

    Something that could be useful would be an option to rename the original document (with _orig for example) when getting back the annotated PDF from the tablet (option doing the opposite as the one adding the "_annotated"). This would help for viewing by default the annotated document, but still having the original version if one wants to print/send a clean version.
    A second reason for this is that getting back and sending again on the tablet would delete the "_annotated" if the option "rename when sending" is enabled (which I did until now).
    Also in relation to this an option for updating the computer version without deleting the one on the tablet would be very useful (there are some reviews that I want to keep on the tablet, but still see the modifications on the computer - it is possible to take it back and send it again, but because of the renaming this is not perfect).
  • To provide some more information on my request for help (see above), this is from the error console:

    Zeitstempel: 08.09.2015 14:35:47
    Fehler: ReferenceError: zotfile is not defined
    Quelldatei: javascript:%20zotfile
    Zeile: 1
  • @zurpher -- have you simply tried reinstalling ZotFile?
  • @adamsmith

    I've now tried your suggestion. I've uninstalled Zotfile - restarted Firefox - installed Zotfile - restarted Firefox with no success.

    I could create a new Firefox profile and try to get it working there. However, this does not help in identifying which Firefox settings might interfere with the Zotfile extraction feature. I assume it must have something to do with pdf.js

    All setting for extensions.zotfile.pdfExtraction.* are default.

    The follwowing PDFJS values are user set:

    pdfjs.migrationVersion;2
    pdfjs.previousHandler.alwaysAskBeforeHandling;true
    pdfjs.previousHandler.preferredAction;4


    Could any of those settings cause trouble?
  • Hi,

    sorry if this has been asked before, but due to zotfile forum being one endless discussion this is difficult to establish. My old e-reader broke down, so I changed to a new one (boox m96 running android 4.0.4, on mac OSX laptop). When I now try to send some files to the tablet, zotfile tells me that the file is already on the tablet, and does not send it. However, the file is not on the tablet. I also cannot get it from the tablet. How can I reset zotfile thinking it is already on the tablet?
    Note that this only happens with some files, while others can be sent to the tablet without any problem (even those that I have already sent to my old, broken reader)
  • @zurpher -- hard to say. I'd test it out. Generally, zotfile has its own pdfjs build, but it might take preferences from the general one.

    @migugg -- you can manually remove the _tablet tag for attachments.
  • Hi adamsmith,

    thanks for the hint. It does not work. However, I found out a trick that does work, for anyone who has the same problem: If I delete the text that appears in the right hand pane when clicking on the pdf (not in the item view), which says something like:
    "lastmod{1410700782000}; mode{1}; location{[BaseFolder]/"title of article".pdf}; projectFolder{}
    then it works. For some reason deleting the tag, does not delte this command that gets written by the tag. One needs to delete the command by hand.
    best
    For the developper: I dont know whether this is possible, but obviously it would make sense if deleting the tag would also delete this text/command.
  • @adamsmith I've changed the Firefox PDFJS configuration values with no success. I've now installed the standalone version of Zotero incl. Zotfile. Extraction of annotations works fine with the standalone version.
  • adamsmith and I discovered a renaming behavior that seems to be caused by Zotfile. It would be great if Zotfile could be updated to be a bit less aggressive in Zotero Standalone so that it is possible to import files without them being automatically renamed.

    Here is my description of the behavior from another thread:
    How do I suppress renaming when adding a PDF attachment via right click on entry, then "Add Attachment" then "Attach Stored Copy of File..." in Zotero Standalone (ZSA)?

    When I do the same in Zotero Firefox (ZFF), the PDF file name remains unchanged. I want the same behavior for ZSA.

    I have Zotfile installed in ZFF and ZSA but both switched to "Use Zotero to Rename". I therefore do not understand the different behavior of ZFF and ZSA. Am I missing something in the Zotero Preferences?
    Thanks for Zotfile. It is a great plugin and I hope it continues to be improved further.
  • I have a scanned text, OCR'ed with Adobe Acrobat XI Pro using ClearScan.

    I use Firefox (41.0), ZotFile (4.1.6), Zotero Standalone (4.0.28.6), Windows 7

    When trying to extract my annotations, I get a notice “Zotfile: Extracting Annotations…” but then the circle stop after about a quarter, the notice disappears and not extractions are imported into a Zotero note.

    I can copy and paste from that document so it should work. Any ideas?

    When I searched the internet for other ways to extract documents, it is often mentioned that one has to activate:
    Copy selected text into Highlight, Strikethrough, and Underline comment pop-ups
    I wonder how that interacts with ZotFile, which does not seem to require this preference to be selected. Can I activate it or will this create problems with ZotFile?
  • "Copy selected text into Highlight, Strikethrough, and Underline comment pop-ups" should be unrelated. Can you post the pdf online?
  • Yes, I posted the annotated version that is causing extraction problems to the Zotfile folder.

    Thank you for looking into this.
  • I can't see it. The only reference in there is "Bobak" without an attachment. I am not looking regularly and have the feeling that someone is deleting files from the group...
  • Strange, when I log in via the web interface I see the following:
    Title Added By Updated On
    Was ist Unterricht? zurpher 02.10.2015 07:30:31
    title phil parker 02.10.2015 00:49:57
    I can access the attached PDF in the browser window as well.

    I have no idea why you cannot see it. Should I email it to you?
  • Now it showed up. I just committed a change that should fix the problem but it's only in the dev version on github right now. You can see the note with the extracted annotations in the zotfile group.
  • Thanks for fixing this.

    I see plenty of � symbols in the extracted annotations but I assume it's down to the OCR, right?
  • Yes, looks like zotfile can't do anything about that. The PDF is still pretty bad (copy & pasting from Preview (Mac) shows the same symbol). There is, however, an hidden option to make corrections using the `pdfExtraction.replacements` option (http://zotfile.com/#hidden-options). Be careful though because they work for all pdfs.

    ps: The spacing problems are another issue but that's really hard to fix without breaking other pdfs.
  • edited October 6, 2015
    I've been having the same problem as @zurpher for a few months -- when will a fixed version be available to download @joscha?

    Update: got the version off git-hub and it fixed it. THANK YOU!!
  • I changed about:config prefs info_window_duration and info_window_duration_clickable from 8000 to 10000. This change seems to have broken the Add New File command. And the info window showing I had a new file in the download folder stopped working too.

    Changing them back to 8000 fixed it.

    Firefox 41.0.2. 2013 Macbook pro, 16 GB, os 10.11.

    Zotfile is incredibly helpful. Thank you for writing it.
  • @ahmontgo and @Gracile about logical page numbers:

    The "Use actual article/book chapter page for highlighted text snippets"-option simply adds the first page in the page field of the item in Zotero to the pdf page of the extracted note.

    There is no support for the kind of "logical page numbers" that can be encoded in a pdf. It could probably be done though, see this old issue in the issue tracker about this:
    https://github.com/jlegewie/zotfile/issues/57
  • Zotfile does a better job of extracting highlights than any other tool I've used. I would like to find a way to use the zotfile version of pdf.js straight from the command line, maybe by converting it into a node command-line package. I would pass in a pdf file as an argument, and output either a JSON object containing all the annotations along with some metadata, or a long text string containing the same information.

    Can you offer any advice on how to start a project like this? My js skills are pretty remedial, but my workflow for pdf's doesn't run easily through Zotero, so I'd love to have the command-line tool. It would likely be useful to others, too.

    (another option, possibly easier, would be to expose the zotfile API in such a way that zotxt could send a stream to PDFJS.getPDFannotations and return the output. I'm not quite sure what's involved with that, either, but I'd be willing to investigate it.)

    Many thanks in advance!
  • Matt -- anything else on this please take to zotero-dev, it's leading too far here, but the general approach should be pretty simple:
    1. check with what flags zotfile runs pdf.js to extract annotations
    2. just download pdf.js from zotfile's github
    3. run it with node.js or rhino (it is my understanding that pdf.js text extraction will run in any javascript engine) and the flags from 1.) and pass the output on to a script that puts the annotations in any format you want.
  • @adamsmith -- thanks, I'd forgotten about zotero-dev and will move discussion there. But first I'll try to follow your instructions (will take my poor li'l brain a few tries I think) and then follow up.
  • Apologies in advance, but I'm a complete newb here! Started using Zotero as I wasn't entirely thrilled with Sente and when I stumbled across the Zotfile plug in, I was sold. Problem is, I can't get it to work! My source folder for attaching new files is set as the Firefox download folder, my base folder in tablet settings is directed to a folder on Dropbox... I can retrieve PDFs just fine in iAnnotate and Notability, make annotations, then "get" them back in Zotero. However, when I attempt to extract annotations, I wind up with the dreaded red X... Help?
  • first thing to check would be -- when you open the pdf in Zotero, are you still seeing the annotations?
  • @adamsmith Nope. I've never been able to see annotations in Zotero. Sorry for not being entirely clear; by being able to "get" annotations from tablet, I meant that I am able to choose the "Get from tablet" option from the Manage Attachments menu, and the progress window seems to show that it does in fact retrieve the file. However, no annotations ever show up...
  • There's two different parts to this, though, and we need to be clear on what's not working.
    1. You actually get the PDF with annotations back to Zotero. I.e. when you double click on the PDF in Zotero, it opens and you can see your annotations in whichever PDF viewer you're using. If that's not the case, extraction can't work.
    2. You do see annotations for the PDF, but they don't extract.
    Still not clear which of the two we're referring to, though it sounds like 1?

    IN that case, could you describe your workflow a bit more? The "Get from Tablet" method has nothing to do with source or base folder, so it sounds like you're misunderstadning something.
  • Hi Joscha.

    It seems to me, there is some problems with Russian characters in document and folder names.
    I choose folder name, that contains a Russian caracters in Custom Source Folder for Attaching new Files on "General Settings" Tab. It's displayed incorrect and a pop-up message "The source folder is not valid. Please change the the source folder under Zotero-Actions-Zotfile Preferences. You might have to use a custom folder." is appears (folder is exists, it's in my home folder and i have a full access rights on this folder).

    Other settings are default.

    When I tries to rename a PDF File, there is a message "Unknown error! (Click here to copy details about unknown errors to the clipboard)". When I click this message, a string "{}" is appears in clipboard.
    (The "Use Zotero to Rename" on Renaming Rules tab is off).


    I use Windows 7 x64, Firefox 42.0, Zotero 4.0.28.7 and ZotFile 4.1.7
  • Hello. My apologies if the following question has been addressed. How to disable the automatic sync to my dropbox everytime I download an article? I can't seem to find the correct box to check off in Zotfile Preferences. Thanks.
  • sorry, that's not quite clear as a question. What do you mean by "automatic sync" here? What specifically do you not want to happen? (ZotFile doesn't do any syncing in the technical sense of the term).
This discussion has been closed.