Generic Translator for PDF URLs?

I often want to create bibliographic entries for PDF reports that are open in a web browser, e.g., http://www.nrel.gov/docs/fy10osti/45889.pdf . Sometimes I come to these via Google Scholar, but often I find them via other means. At any rate, I usually make the decision to add the report to my Zotero database once I have the PDF open in my web browser.

At present, the only way to add the PDF to Zotero and get bibliographic information is as follows:

(1) Drag and drop the PDF's URL from the web browser to Zotero standalone, being careful not to add it to an existing reference.

(2) Search for the PDF reference within my Zotero library.

(3) Wait for the PDF to finish downloading.

(4) Right-click on the PDF reference and choose "Retrieve Metadata for PDF".

Would it be possible to create a generic translator that performs all these steps? This would save me a lot of time -- just click once in the browser and let Zotero take care of the rest.

Ideally this translator would be active for any .pdf URL that isn't recognized by other translators. Surely that would be more useful than just graying out the Zotero button.

I use the Zotero connector for Safari, but I think the same translator could work for either the connector or Firefox versions of Zotero. This would also be more useful than the results you currently get in Firefox when you right-click on the PDF page and choose Zotero -> Create Web Page Item from Current Page. (That just builds a title from the filename and PDF metadata, which is usually wrong and also prevents automatic retrieval of metadata later.)

Thanks!
  • such a translator would at least be non-trivial, as the "retrieve metadata" functionality is not directly accessible via translators and it wouldn't be easy to do that, since it requires the full text to be indexed in Zotero (which relies on yet another process to run). I'm also not sure how devs feel about including a translator that isn't really one and can easily fail when no metadata is found.

    In Firefox, the regular save dialog for PDFs actually gives you an option to save to Zotero and immediately run "retrieve metadata", so for Firefox users that's already solved pretty elegantly, but the save dialog can't be modified for other browsers.

    I think the way to handle this for the connectors is analogous - there should be a button that allows saving PDFs and other non-supported webpages more easily (and without finding the right-click menu). That button could include a "retrieve metadata" option - by default maybe even - when used for PDFs. Dan has repeatedly said that he would like to see saving non-supported pages from the connectors improved, so I think prospects for this are quite good, though likely not super soon.
  • Thanks for the quick and thoughtful response. I might have guessed it would be something like this. It sounds like the main problem is that the translator has no way to clearly and quickly identify the PDF file - that's done by the more complex metadata lookup process.

    I can't get the save-to-Zotero option to display in Firefox for Mac, but in general that approach sounds like it could work well -- punt the file to Zotero (including via a connector) and let it do the rest.
  • You should get the dialog in Firefox when you use the download option (at the top right) from the built-in PDF viewer, for example.
  • In Firefox, I only seem to have two options and neither imports the PDF to Zotero or retrieves metadata for it.

    When viewing a PDF with the built-in viewer, there is an extra bar at the top of the viewer, with a button identified as "download". (It looks like a document page with a down arrow on it.) When I click this, I get this dialog box (at http://i.imgur.com/11rtzoi.png):
    image

    Based on other discussion on this forum, I expected this dialog box to have an "export to Zotero" option, but it only allows me to save the file or open it (generically) with a specified application. If I use "Other..." to choose Zotero, then Zotero gives me an import-confirmation dialog followed by a message that "The selected file is not in a supported format." (I think it's trying to open it as a bibliography rather than an attachment. This is probably the standard behavior whenever Zotero is called to open a file from the command line rather than via some API.)

    Alternatively, on the main Firefox toolbar, there is a big down-arrow button labeled as "Display the progress of ongoing downloads". If I click on this and then click on the name of the current PDF, Zotero tries to open the PDF in the same way as noted above. (I doubt this is the standard way for Firefox to open PDFs; more likely it just remembered the choice I made the last time I clicked the "download" button on the PDF viewer bar.)
  • When I click this, I get this dialog box (at http://i.imgur.com/11rtzoi.png):
    Based on other discussion on this forum, I expected this dialog box to have an "export to Zotero" option
    that's correct. ("Save to Zotero" to be precise, but potatoe-potato).
    And you have Zotero for Firefox installed and working?
  • I have Zotero for Firefox installed, but it turns out I was unwittingly running it in connector mode, since I opened the standalone Zotero before I opened Firefox. I closed the standalone Zotero, then restarted Firefox, and now the "Save to Zotero" option appears from Firefox's PDF download dialog box. The Zotero link on the bottom, right corner of the status bar also opens Zotero within Firefox (previously it was activating the external copy of Zotero).
  • It would be nominally possible to make a translator that ran on PDFs, parsing them with pdf.js and looking for the same key phrases we use for the metadata lookup; pdf.js could in theory be baked into a translator for this purpose.

    One interesting side-effect of this is that the details of pdf metadata lookup would be moved out of the main guts of Zotero, which are updated only in each release, and into the translators system, which can be updated at any time in live clients.
Sign In or Register to comment.