Cannot view pdf file in browser

I have Zotero 1.0.3 and Firefox 2.0. I also have Adobe Acrobat Professional 7.0 running on Windows XP.

I am trying to view a pdf file from my library in the browser window - but it brings up a dialogue box asking me to "open with" or "save to disk". I have tried choosing Firefox.exe from the "open with" list - that didn't work. I installed PDF Download 1.0.1.1 - still no luck.

From Zotero I can open the file in Acrobat just fine, just not in Firefox.
  • When you click on a PDF from a web page, does it open in Firefox or do you get that dialog box?
  • When I click on a pdf link on a web page - the pdf document opens up in the browser (no dialogue box).
  • Does this happen for all PDFs (from different sources) or just some?

    We'd need debug output to know what's actually happening.
  • It happens with all PDFs.

    I completed step one of debug process, step two didn't work. When I enter “C:\Program Files\Mozilla Firefox\firefox.exe” -console into the command prompt I get an error.

    Unsure how to get the console to come up with FireFox.
  • Sorry, the wiki was converting the quotes to smart quotes instead of straight quotes. Try copying the command again from that page.
  • edited March 28, 2008
    So here's what I did; I expanded a Zotero item, left-clicked the pdf that is attached to the item, clicked the "View File" button, then I chose FireFox.exe from the "open with" list in the dialogue box that popped up. Here is the console info:

    (I had to cut the top portion out due to "too long" error)

    [output removed]

    zotero(5): SELECT linkMode, path FROM itemAttachments WHERE itemID=4918

    zotero(3): MIME type application/pdf can be handled by plugins

    zotero(5): SELECT linkMode, path FROM itemAttachments WHERE itemID=4918

    zotero(3): Translate: binding sandbox to about:blank

    [output removed]
  • edited March 28, 2008
    Well, based on the output, Zotero is correctly detecting that there's a plugin to handle the file. At that point it just passes it off to Firefox to load, so I'm not sure why the Acrobat plugin isn't picking it up. Firefox also appears to be loading about:blank (the default placeholder page in Firefox) immediately after the load, which is odd.

    You might want to check the Download Actions in the Firefox prefs under Content->File Types->Manage. Find the entry for PDF, double-click on it, and make sure it says "Use this Plugin: Adobe Acrobat".

    If fiddling with that doesn't work, I'd try disabling all your other extensions, uninstalling and reinstalling the Acrobat plugin, and trying again.
  • For what it's worth, I have the same problem when trying to open pdf files in gmails.
  • I had the same problem. The problem was that Firefox had two entries for handling PDF files. Check your "File types" preferences:

    Tools->Options->"File Types" click "Manage..."

    This displays a list of all file types that Firefox knows how to handle. Look for "Adobe Acrobat Document". You should one entry under this name. Click "Change action" to view the settings. It should be configured to use the Acrobat plugin.

    if you have two entries, the problem I had, one will probably be a "Save As..." action. Remove this action, I think it gets created when Firefox asks you "if you always want to do this for files of this type" I must have clicked yes at some point.

    If you don't have an "Adobe Acrobat Document" entry, then Firefox doesn't know about the acrobat plugin. If you have Acrobat installed, then I'm not sure what the best fix is, Firefox does not seem to let you make a new action from scratch. Maybe remove and re-install Acrobat, but this might cause other problems.

    (This should also fix your PDF/gmail problem)
  • I'm having the same problem with zotero not begin able to pull up PDF files for viewing in the browser window. Using Windows XP, zotero 1.0.4 and acrobat pro. Firefox has no trouble opening other PDF files except from within zotero.

    My "File types" preferences have only one entry for PDF files, and that is the acrobat plugin.

    My debug output is as below:

    zotero(5): SELECT linkMode, path FROM itemAttachments WHERE itemID=6426
    zotero(3): MIME type application/pdf can be handled by plugins
    zotero(5): SELECT linkMode, path FROM itemAttachments WHERE itemID=6426

    showing that zotero does detect the plugin.

    Anyway, I had moved my zotero library to a network attached storage (NAS) drive share, and that seems to be the problem. When I use the library from within the firefox profile directory, it pulls up PDF files just fine. There are no spaces or other funny characters in the shared drive name, etc.

    Why should this be? The funny thing is that I just tried to pull up the library from a zotero on a linux machine from the same shared drive, and it does not show it in the browser either. It's not a permissions problem, as if in zotero on either machine I click "Show File", and then double click on the file icon, an acrobat window comes up with the file...
  • Anyway, I had moved my zotero library to a network attached storage (NAS) drive share, and that seems to be the problem. When I use the library from within the firefox profile directory, it pulls up PDF files just fine.
    What if you try to open within Firefox (not Zotero) from the shared drive—for example, by clicking Show File and then dragging the PDF from Explorer into Firefox?
  • Opening the PDF file from the shared drive via Firefox's "Open File..." works.

    I made an error above. When I copied the zotero directory from the shared drive to mozilla's profile directory, it did not fix things. A slightly older version of the directory which had already been in my local profile directory does however work. Thus, I think this is a manifestation of the zotero directory having become maybe corrupt. Another problem that led me to find this is that using that problematic zotero directory, I did not see a "Save to Zotero (NCBI Pubmed)" icon in the address bar when viewing pubmed, etc references. That was back using the functioning library. I've just brought my out of date but working zotero directory back up to date, and will try copying that to the share drive to see if it works.
  • I can verify that copying the "good" zotero directory to the shared drive works: double clicking on a PDF attachment opens it in the window. Also, the "Save to Zotero..." icon is back in the address bar. Going back to the "bad" zotero directory, neither of these work (but I can otherwise view the entire library it seems, with no other indication of error).

    I've created debug output for the two directories, but they are rather large (>4000 lines for the bad, ~800 for the good). On comparison of the debug logs what stands out is 1) the 'bad' does check the repository for updates, where the good does not, and 2) then near the end of the output in the 'bad' , there is the following:

    zotero(5): SELECT translatorID, translatorType, label, target, detectCode IS NULL as noDetectCode FROM translators ORDER BY priority, label
    zotero(1): [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageStatement.executeStep]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://zotero/content/xpcom/db.js :: anonymous :: line 86" data: no] [QUERY: SELECT translatorID, translatorType, label, target, detectCode IS NULL as noDetectCode FROM translators ORDER BY priority, label] [ERROR: database disk image is malformed]

    The last bit sounding ominous. Surprising why there's no other visual feedback of this...
  • In the "bad" copy, click Reset Translators and Styles in the Advanced pane of the Zotero prefs, and then run the database through the DB Repair Tool.
  • The above (Reset Translators... and DB Repair Tool) fixed the problem. I can now open PDF file attachments from within Zotero, and the "Save to Zotero.." icon is back for appropriate web pages. Thanks! I still do think there should be visual feedback of a corrupted database upon opening the zotero pane the first time, or on firefox startup.
  • edited August 27, 2009
    Hi
    i seem to have this problem also and can't figure out if firefox or zotero is my culprit. Was gonna try the "Reset translator and style" suggested above and then running the DB repair tool but i got stopped by this ominous looking warning " all new translators and styles will be lost" (sorry, translating from french, this might not be the exact warning). As this is but a minor inconvenience, would someone please tell me what is at stake by restting those?. Also, my debug output is (since it's a bit long i'll put what i think is relevant, please ask for more if you need more, and thx for your time ;) ):

    getAttachmentMIMEType() deprecated -- use .attachmentMIMEType
    MIME type application/pdf can be handled by plugins
    (...)
    Username not set before setting Zotero.Sync.Storage.password

    (5)(+0000001): SELECT COUNT(*) FROM fulltextItems WHERE (indexedPages IS NOT NULL AND indexedPages=totalPages) OR (indexedChars IS NOT NULL AND indexedChars=totalChars)

    (5)(+0000001): SELECT COUNT(*) FROM fulltextItems WHERE (indexedPages IS NOT NULL AND indexedPages<totalPages) OR (indexedChars IS NOT NULL AND indexedChars<totalChars)

    (5)(+0000000): SELECT COUNT(*) FROM itemAttachments WHERE itemID NOT IN (SELECT itemID FROM fulltextItems WHERE indexedPages IS NOT NULL OR indexedChars IS NOT NULL)

    And well, the rest seems fine to my untrained eye. Also, i couldn't open a pdf in ff from the "open file" directly in ff. Also, in ff prefs => application, all pdf-related are set to open via the firefox plugin (except one i couldn't change :pdf-force-download). I did some test to find out if some other pdf had problems (not stored in zotero) and found the exact same problem on some web-hosted pdf file. For instance, there are 2 pdf location at this search
    http://scholar.google.ca/scholar?cluster=17190605803432086776&hl=en

    and the first gives me the same error as when i try to open in ff from zotero storage while the other one works like a charm. Also, i think it very worthwhile mentionning that this problem is new (i.e. it use to work just fine maybe 2 weeks ago). Thx all for the time you put in this, and i will make sure to pay it forward.
  • edited August 27, 2009
    NickAdam: Disregard the stuff about resetting translators and styles—that was specific to the error amishdave was getting.

    http://forums.zotero.org/discussion/7293/trouble-using-firefox-plugin-to-view-pdfs-in-browser-window/#Item_5
  • Hi everybody

    i recieved this problem (pdfs do not open in tabs but dialogue save to / open with adobe reader) on a win7 / zotero2.1.8 / ff4 and ff5 system, and somewhat later on my macosx 10.6 / zotero 2.x / ff 4 and ff5 system.
    i had no problems saving items to zotero.
    deleting mimetypes.rdf on win7 did not help.
    i am using adobe reader X

    any ideas if my problems is rather the above mentioned problem or something else?
  • to be more precise, the problem started in a ff4 / adobe reader 9 environement, updating to to adobe reader X and later to ff5 did not solve anything, neither on my win7 nor on the mac system.
  • debug id D581176671...
Sign In or Register to comment.