Giter Club home page Giter Club logo

zotfile's Introduction

ZotFile: Advanced PDF management for Zotero

Joscha Legewie

Zotfile is a Zotero plugin to manage your attachments: automatically rename, move, and attach PDFs (or other files) to Zotero items, sync PDFs from your Zotero library to your (mobile) PDF reader (e.g. an iPad, Android tablet, etc.) and extract annotations from PDF files.

Detailed information are available from the zotfile website.

Development status

Zotfile is currently not actively developed and maintained! Updates are extremely rare and I will mostly not respond to issues and pull requests here on github.

Installation

For Zotero 5, first download the extension file (follow the download link above, click on the .xpi file for the most recent release). Now start Zotero 5 and go to "Tool -> Add-ons -> Tools for all Add-ons (the small, drop-down wheel in the top right corner) -> Install Add-on From File" and select the downloaded .xpi file. For Zotero 4.x, the process is different for Zotero for Firefox and Zotero Standalone. For Zotero 4.x Firefox, go to the Mozilla Add-Ons page and follow the instructions. For Zotero 4.x Standalone, use the same steps as for Zotero 5 but download the .xpi file from here

To install the development version on github:

  1. download .zip file from github
  2. extract .zip file
  3. recreate .zip file containing all the files at the top level, i.e., install.rdf and the chrome directory need to be at the root of the .zip file and not under zotfile/
  4. rename the file to .xpi
  5. Install
  • For zotero firefox: drag & drop on firefox
  • For zotero standalone: In Zotero Standalone go to 'Tools->Add-ons->Tools for all Add-ons (the small, drop-down wheel menu next to the 'Search all Add-ons' box)->Install Add-on From File' and pick the .xpi file.

For Linux, Mac OS X or Cygwin users, there is a Makefile which takes care of creating the .xpi file. Simply run make instead of steps 3 and 4 above.

Extraction of PDF Annotations

Zotfile can extracted annotations and highlighted text from many PDF files. But it will never be able to handle all files. If you can not copy & paste meaningful text from the file in your pdf viewer (open your pdf viewer (not the browser plugin), select text, copy and paste it somewhere), zotfile won't be able to extract the highlighted text either. If you can, there is a chance that future versions of zotfile will solve the problem. In general, these files depend on the pdf standards supported by pdf.js, which is the pdf library used by zotfile to extract annotations.

License

The source code is released under GNU General Public License, version 3.0

Contributions preferably through pull requests are welcome!

Changelog

The full changelog is available here.

zotfile's People

Contributors

ahrendsen avatar aurimasv avatar bitnikrbt avatar bwiernik avatar dstillman avatar fbennett avatar gracile-fr avatar jjatria avatar jlegewie avatar jmhammond avatar jmuccigr avatar ldeng-ustc avatar melat0nin avatar mikkovedru avatar natejlong avatar nils-werner avatar ptgolden avatar qingqyang avatar qqobb avatar rag2ko avatar robin-gdwl avatar robintw avatar simpzan avatar sohamm17 avatar tete1030 avatar unode avatar vancleve avatar watercrossing avatar zbiener avatar zuphilip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zotfile's Issues

et al not working for 5e45d8d

I was playing around with the latest version 5e45d8d and noticed that renaming with omitted authors correctly only uses the first author but doesn't add the specified string any longer (usually et al). Must be a relatively new bug.

Extraction of annotation crashes in group libraries

"I am using Zotfile to extract annotations from PDF's inside my group library, and I keep getting the error message:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80630003 (NS_ERROR_STORAGE_CONSTRAINT) [mozIStorageStatement.execute]" nsresult: "0x80630003 (NS_ERROR_STORAGE_CONSTRAINT)" location: "JS frame :: chrome://zotero/content/xpcom/db.js :: <TOP_LEVEL> :: line 145" data: no] [QUERY: INSERT INTO itemNotes (itemID, sourceItemID, note, title) VALUES (?,?,?,?)] [ERROR: insert on table "itemNotes" violates foreign key constraint "fki_itemNotes_libraryID"]

I double checked the following already:

  1. I can manually create notes as a child of this zotero library item
  2. I have admin permissions
  3. I tried to extract annotations to the exact same pdf copied in my local library, and it works every time.
  4. Every pdf in my group library (I have 2 diff groups, 1 with admin, 1 with ownership) I get this exception error."

problem with adding tag when sending items to tablet

http://groups.google.com/group/zotero-dev/browse_thread/thread/d3849d98952706d3

Report
"Each time I start zotero everything works perfectly and I can move files up to dropbox and back. However, each time after I move a few files something changes. I click the "send to tablet" and it gets sent to dropbox, however no window pops up to show its being sent. Then when I right-click the file, it gives me no option to "get from tablet", its greyed out. If I close and restart firefox, it starts working again. I tried it with different files and zotero items and that does not seem to be the problem. Sometimes the same file would work and sometimes it wouldn't. It just seemed to be that after 2 or 3 successful "sends" and "gets" the "get" stops working."

" just cleared the error console and tried to send a file. It once again synced to dropbox but gives me no option to "get" from dropbox. The error reads:

Error: uncaught exception: Cannot add invalid tag 38 in Zotero.Item.addTagByID()"

no "Send to subfolder on tablet" after upgrade to Zotero 3.0.7

yesterday I have upgraded zotero and my zotfile is reported to be 2.1

now there is only a "Warning" in "Send to subfolder on tablet" portion of the contextual menu for "Manage attachments"
also in debug console there are messages

Error: Zotero is undefined
Source File: chrome://zotfile/content/zotfile.js
Line: 427

every time I get to that submenu

option to create copy of file in foreground mode

maybe as mode=3 or with mode=2 and create copy of annotated file option?

http://forums.zotero.org/discussion/5301?page=6#Item_246

"I want to keep two copies of each file, the original file and an annotated copy. What's the best way to achieve this? Since I'm using the foreground mode, "Save copy of annotated file with suffix" isn't useful to me.

It would be very nice if Zotfile could copy files instead of moving them, with an optional prefix/suffix added to the filename, and add a link to the copied file in Zotero. Something like a hybrid between the current foreground and background mode; I don't mind if it's a hidden setting. This way I can have my working (annotated) copy on all my devices and keep the original in Zotero, e.g. for sharing with colleagues."

Change file metadata

I use okular for viewing pdffiles and it use the title metadata in the window title.
But this field is not always correct depending on how the pdf was generated.
It would be nice if we could change this field just like we change the file name.

Do not use automatic renaming if multiple attachments exist

I am using the default settings. I have an item in a group library. This item is a book and I have each chapter scanned as a separate attachment and I have named these files my self. When I drag this item from the group library to my library, ZotFile renames all the attachments using the same file name.

My suggestion is to not use the automatic file renaming when multiple attachments exist.

Attachment subfolder naming error

On OS X: with the custom attachment location set to /custom/location/path and the subfolder string set to /%s|%j/%y, my files end up on the path /custom/location/path_/%s|%j/%y. If instead I use /custom/location/path/ and %s|%j/%y, my files end up on the path /custom/location/path/%s|%j/%y. So the the first way adds an extra "_" to the end of the custom location path while the second way does not. Even though the second way works okay, I feel like it's a bug that the first way does not because when the "Choose" button is used to select the custom location, the path that is generated does not have the trailing "/".

zitem.getType is not a function error (bug report from zotero forum)

b) Error says: zitem.getType is not a function and is related to the code:
// Function replaces wildcard both for filename and subfolder definition
replaceWildcard: function(zitem, rule){
// get item type
var item_type = zitem.getType();
var item_type_string = Zotero.ItemTypes.getLocalizedString(item_type);

c) I am currently on Windows 7 x64, but tried also on Windows 2003 Server x64 and Ubuntu 10.04... all of tested in CZ localization.

Support for calibre?

Hi,

I use calibre to manage ebooks for my ereader. It would be nice if zotfile, after (or instead of) pushing a file to a particular directory for "Send to tablet", would call the calibredb program, e.g.

calibredb add --author "Jane Doe" --title "Foo" foo.pdf

I've had a quick look at the source and it looks like this could be added to the end of the sendAttachmentToTablet function. I can look into it, but it might require abstracting sosendAttachmentToTabletme code (e.g. calling an executable).

My ereader does not support annotating texts so that is not an issue for me. I don't know if it is an issue for others.

problem with special characters in subfolders based on meta data

"In the article put in the zotfile's group, the publication name is Transportation Research Part D: Transport and Environment. When I removed the colon (:), everything seemed to work flawlessly (in 2.1).
Therefore, I thought that if the code processed such a field in the same way the title is processed (cutting the part after ':'), then it should work."

subfolders create problems if a field is missing

"Another problem happens when using subfolders (e.g., %T%w%y) and a field is missing. In that case, one cannot use "locate the file" since the path is known as, e.g, "%T%y" instead of "%T%y". It is however strange to me that directly opening the file works smoothly (as if the path was defined or interpreted differently).
Anyway, I think the best solution to both avoid this error and provide a systematic classifying would be to replace missing field(s) by a common name specific to the field, as it should be done in a bibliography.
Example:
root\Journal Article\Journal of Power Sources\2005
root\Journal Article\Unknown journals\2005
root\Journal Article\Journal of Power Sources\Unknow dates

"Unknown journals/dates" replacement names are just examples. One could imagine "Undefined journals", "Other journals", "NA dates" or the French "[s.d.]" (sans date)."

zotfile menu crashes after closing and reopening FF window

"Bug report: When I close all FF windows and open one again (without quitting FF), Zotfile context menu from the list pane (e.g. Rename Attachment) has 'warning' above it and doesn't work. It recovers only when I restart FF. I'm on FF 10.0, OSX 10.7.2, but it happened with FF 8, too."

Portable links

I carry my library on flash, so when I switch computers it gets different letter and links do not work any more.
Could you add an option for links that are relative to the "Source Folder for Attaching new files" custom folder, so its enough to only change this option ?

More, you could let custom folder to be relative to Zotero folder so I don't have to change anything when switching computers.

Thanks.

extraction problem "core.js :: getPdf :: line 55"

"I am having trouble with the annotation extraction using Zotero Standalone on Windows. I can't get extraction to work on any file, even the test file you provided above. When I initiate extraction, the pop-up box comes up and the progress bar never moves; finally I have to escape out of the process. The following error in the log appears to be related:

[JavaScript Error: "uncaught exception: [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: chrome://zotfile/content/pdfextract/pdfjs/src/core.js :: getPdf :: line 55" data: no]"]

Any suggestions?"

lua pdf support

can someone add support for kindle device kpdfviewer which stores highlights,text in a separate .lua file in the same location.

more info: http://www.mobileread.com/forums/showthread.php?t=157047

sample .lua file:return {
["globalzoom_mode"] = -4,
["highlight"] = {
[1] = {
[1] = {
[2] = {
["y0"] = 209,
["x0"] = 73,
["y1"] = 217,
["x1"] = 510
},
[3] = {
["y0"] = 219,
["x0"] = 73,
["y1"] = 227,
["x1"] = 517
},
[1] = {
["y0"] = 199,
["x0"] = 451,
["y1"] = 207,
["x1"] = 516
},
[4] = {
["y0"] = 230,
["x0"] = 73,
["y1"] = 238,
["x1"] = 522
},
[5] = {
["y0"] = 241,
["x0"] = 73,
["y1"] = 249,
["x1"] = 482
},
["text"] = "a Wikipedia article and classified into one of five abstract concept categories: Research Field, Technology, System, Term and Other. Using the content of the matched Wikipedia article, the system then constructs a conceptual graph structure representation for each key phrase and the questions are then generated based the structure. To evaluate the quality of the computer generated questions, we conducted a version of the Bystander Turing test, which involved 20 research students who had written literature "
}
},

the ["text"] field contains the annotation to be extracted. How to modify extract.js to accomplish this?

Option to remove dots from filenames.

I'd like to to add an option to remove any dots from renamed filenames. I can add this to the renaming function without a problem but I'm not so sure about how to add that to the preferences.

fix spaces problem in pdf.js extraction

Example 1: Golder and Macy 2011
Document available via email

pdf.js - "fromdaytoday.DoddsandDanforth(14)showed howtheaffectivevalenceofsongs,musicians,and blogpostsdependsonthedayofweek,especially holidays. In an unpublished study, Mislove et al. (16)usedTwittermessagestoexaminewhatthey refer to as the“pulse of the nation” as it varies across the week and moves across time zones." (Golder and Macy 2011:1879)

poppler - "from day to day. Dodds and Danforth (14) showed how the affective valence of songs, musicians, and blog posts depends on the day of week, especially holidays. In an unpublished study, Mislove et al. (16) used Twitter messages to examine what they refer to as the “pulse of the nation” as it varies across the week and moves across time zones." (Golder and Macy 2011:1879)

Example 2: DiPrete and Buchmann 2012
Document available via email

"women’s gains in education are part of a larger story ab out the changing place of women in the lab or market and in so ciety more generally. But the female favorable trends in education are marked by three imp ortant features that indicate that these trends do not follow solely from the women’s changing status in so ciety. First, women have not merely gained educational equality with men; on many fronts they have surpassed men by a large and growing margin. Second, the female advantage in educational attainment has o ccurred even as gender differences in educational sp ecialization have p ersisted. Third, the size of the gender gap differs considerably by race and ethnicity. These three features have farreaching implications for American so ciety and raise imp ortant p olicy questions." (DiPrete and Buchmann 2012:14)

"It is story ab out female’s real gains in education but also male stagnation in education that raises daunting challenges for American so ciety." (DiPrete and Buchmann 2012:14)

"It is imp ortant to understand, however, that America’s stagnation in college completion is largely due to the stagnation of mens’ college completion rates. Among cohorts b orn after World War I, females b egan closing the gap with males and their gains accelerated in the p ost-Vietnam years. Women b orn in the late" (DiPrete and Buchmann 2012:14)

Customizable character substitution

Thanks for all your work on ZotFile. I like the recent improvements, especially the advanced renaming rules, the replace blanks option, the extra wildcards, and automatic attachment renaming for newly added items. Those are all things I had considered adding to a fork of ZotFile (when I didn't realize it was still being updated so frequently). The one related feature I had been thinking about was a more general version of the replace blanks option where the user could enter a string of characters and then another character (possibly empty) and then all of the first characters would be replaced with the second. So you could enter "!@#$%{}" and then "_" and then "The $2.00 solution!.pdf" would instead be "The _2.00 solution_.pdf". Also, it would be nice if this option plus replace blanks and remove periods worked on subfolder names as well as file names (I like to format my folder and file names such that I don't have to escape/quote them when referencing them).

Are these features you would be willing to add to ZotFile? I could help with writing patches if you would like (I am a little busy now, but I would add them to my to-do list).

make renameAttachment function less destructive

Currently, renameAttachment often deletes an attachment item and creates a new one. Only do that when necessary (change from stored to linked attachment)

item.renameAttachmentFile(filename);
item.setField('title', filename);
item.save();

item.relinkAttachmentFile(file);

additional renaming options

  • avoid missing fields and their following separator
  • authors' given names initials, first name
  • day and month of publication date
  • optional wildcards
  • customize what replaces the ":" or "."?"

"renaming rules for the authors' given names initials and for extracting day and month from the publication date."

optional renaming patterns
"I have been trying to format renaming pattern and run into a problem. Is there a way to make something optional? In Zotero renaming patterns { } are used with the intention to include only if this field is not empty. Is there anything like that in Zotfile? The problem is when I add %v and there is no volume number for certain publications, I end up having two spaces in the file name."

" would it be possible to rename the file with even more options? and here I am thinking about renaming files with "Last Name, First Name," (or even "Last Name, Initial of First Name") since quite a few of my references share very common last names… "

"would it be possible to customize what replaces the ":" or "."?"

Bugs?

***********1/ Is it a bug?
Strange behaviour of prompts in getAttachmentFromTablet and getAnnotations

Cancel button is not equivalent to the X (close) icon (tested with win7).
i.e.
Zotero.ZotFile.promptUser(Zotero.ZotFile.ZFgetString('tablet.fileConflict', ['filename']),Zotero.ZotFile.ZFgetString('tablet.fileConflict.replaceZ'),Zotero.ZotFile.ZFgetString('tablet.fileConflict.removeT'),Zotero.ZotFile.ZFgetString('general.cancel'));

=> the order is replace/remove/cancel in the code but it appears as replace/cancel/remove in the UI. That won't be a problem if...:
Result (in execute JS):
cross button=1
replace=0
cancel=2
remove=1

Similar (issue?) with:
Zotero.ZotFile.promptUser(Zotero.ZotFile.ZFgetString('extraction.fileConflict', ['filename']),Zotero.ZotFile.ZFgetString('extraction.fileConflict.useT'),Zotero.ZotFile.ZFgetString('extraction.fileConflict.useZ'),Zotero.ZotFile.ZFgetString('general.cancel'));

***********2/ Not a bug but annoying
When clicking "Choose" button (base folder) in the ZF Prefs, you lose Prefs focus, i.e. "Prefs" window disappears in the background...

***********3/ Error
Error: TypeError: window.ZoteroPane is undefined
Source file: chrome://zotfile/content/include.js
Line: 11

when opening ZotFile Prefs window with Zotero as a pane.

renaming pattern does not support 'period' separator

the renaming pattern containing periods as separator does not work as expected, all the periods disappear. for example
the pattern %a.%t.%y.%s result in "Galvosas_CallaghanFast_magnetic_resonance_imaging_and_velocimetry_for_liquids_under_high_flow2006" while the string
"Galvosas_Callaghan.Fast_magnetic_resonance_imaging_and_velocimetry_for_liquids_under_high_flow.2006" is expected. backslashing i.e. %a.%t.%y.%s does not help either.

automatically rename PDFs when they are attached

"I hope ZotFile could automatically rename the PDFs at the time they are attached: for example, when we save items with 'Preferences -- General -- Automatically attach associated PDFs..' option on."

only delete zotfile information from att note when removing att from tablet

I think this can easily be solved by changing the clearInfo function (but search to make sure).

"1) When you are exporting a file to a tablet directory, your addon is going to insert a command line into the notes window of that specific file like this:

lastmod{1303813244000}; mode{1}; location{[BaseFolder]\European Journal of Medicinal Chemistry\Kaushik et al\Kaushik et al. - 2010 - Design & synthesis of 2-(substituted aryloxy)-5-(s.pdf}; projectFolder{}

If a previous note was existing, it is going to add this command at the end of the note (and that is right!)

The problem comes when you are going to get the file from the tablet directory: in that case everything presents in the note window is deleted (sob!), even though other notes are present before or after the command line inserted by you. is there any way to solve this problem? maybe you could suggest to insert any other notes before the command line and your addon can make a search in the notes and starting to delete stuff after the string "lastmod" for example?"

Use logical page numbers (if available) for reference extraced pdf annotations

A lot of pdf's from academic databases (eg. JSTOR) uses so called "logical page numbers" (at the same time a lot of databases add a cover page to articles, making the page computed from pages-field + page number in pdf wrong). This is true also of many pdf e-books.
It would be great if the annotation extraction could use the logical page numbers (if they exist) and then fall back to the older solution. This of course depends on whether this is supported in the backends, but shouldn't be too difficult to implement in that case. I might take a look at it myself.

Thanks for a great addon by the way!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.