Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Viewing pdf files in chromium-browser

  1. #1
    Join Date
    Nov 2006
    Beans
    409
    Distro
    Xubuntu

    Viewing pdf and ps files in chromium-browser & firefox

    In Ubuntu 10.04, installed Chrome from the Ubuntu repos: chromium-browser 8.0.552.224-r6859

    According to about:plugins mozplugger is supposed to be handling pdf, ps, ppt mime types, but for all of these I get a black browser window saying "Missing Plug-in".

    I'd like to view these filetypes inside the browser using either adobe reader (8.1.6) or evince (or even just gv).

    Here is an excerpt from /etc/mozpluggerrc:
    Code:
    application/pdf:pdf:PDF file
    application/x-pdf:pdf:PDF file
    text/pdf:pdf:PDF file
    text/x-pdf:pdf:PDF file
    	ACROREAD()
    	repeat noisy swallow(kpdf) fill: kpdf "$file"
    	repeat noisy swallow(Xpdf) fill: xpdf -g +9000+9000 "$file"
    	repeat noisy swallow(okular) fill: okular "$file"
    	GV()
    	repeat noisy fill exits: evince "$file"
    
    application/x-dvi:dvi:DVI file
            repeat swallow(kdvi) fill: kdvi "$file"
    	repeat swallow(xdvi) fill: xdvi -safer -hush -geometry +9000+9000 "$file"
    
    application/x-postscript:ps:PostScript file
    application/postscript:ps:PostScript file
    	GV()
    	repeat noisy fill exits: evince "$file"
    Is something missing/wrong in this configuration, or is this version of the browser simply incapable of using these applications to display these filetypes?

    I have no problem viewing these files in Firefox.

    I do NOT want to install the Chrome pdf-viewer plugin.
    Last edited by r.stiltskin; January 15th, 2011 at 04:21 AM. Reason: solved

  2. #2
    Join Date
    Aug 2008
    Beans
    549

    Re: Viewing pdf files in chromium-browser

    Evince document viewer works fine. Is there something wrong with that?

  3. #3
    Join Date
    Nov 2006
    Beans
    409
    Distro
    Xubuntu

    Re: Viewing pdf files in chromium-browser

    Are you using Ubuntu 10.04? chromium-browser 8.0.552.224-r6859?

    Are you saying that you can open pdfs with Evince inside a chromium-browser window? (I can't.)

    If your answers to all of the above are yes, would you mind posting your /etc/mozpluggerrc file?

  4. #4
    Join Date
    Nov 2006
    Beans
    409
    Distro
    Xubuntu

    to view pdf/ps in chrome/firefox edit mozplugger configuration

    Solved. chromium-browser can now open .pdf and .ps files in either acroread, evince or gv. All that was needed was a minor change in the commands to start these programs in etc/mozpluggerrc. (The primary change was to add "needs_xembed" to the macros.)

    Near the top of /etc/mozpluggerrc there is a section headed by
    ###################
    ### m4 macros ###
    ###################

    Near the end of that section I found definitions for ACROREAD and GV, but both were incorrect, and there was none for Evince. I edited it so now I have the following definitions:
    Code:
    ### Acrobat Reader
    define(ACROREAD, [repeat swallow(acroread) fill needs_xembed : acroread -openInNewWindow /a "$fragment" "$file"])
    
    ### GV
    define(GV_OPTS,[--safer --quiet --antialias -geometry +9000+9000])
    define(GV_FLAGS,[repeat swallow(gv) fill needs_xembed])
    define(GV,[GV_FLAGS(): gv GV_OPTS() "$file"])
    
    ### Evince
    define(EVINCE, [repeat swallow(evince) fill needs_xembed: evince "$file"])
    Next, further down in the file there are lines containing the following:
    application/pdf:pdf:PDF file
    application/x-pdf:pdf:PDF file
    text/pdf:pdf:PDF file
    text/x-pdf:pdf:PDF file

    and:
    application/x-postscript:ps:PostScript file
    application/postscript:ps:PostScript file

    Following each line or group of lines, just paste in the macro for the application that you want to use for those filetypes. e.g., to use acroread for .pdf files and evince for .ps files:
    Code:
    application/pdf:pdf:PDF file
    application/x-pdf:pdf:PDF file
    text/pdf:pdf:PDF file
    text/x-pdf:pdf:PDF file
    	ACROREAD()
    
    application/x-postscript:ps:PostScript file
    application/postscript:ps:PostScript file
    	EVINCE()
    Note: I found the essential clue for this solution in the following bugzilla entry:
    https://bugzilla.redhat.com/show_bug.cgi?id=585475
    Last edited by r.stiltskin; January 15th, 2011 at 04:24 AM.

  5. #5
    Join Date
    Aug 2007
    Beans
    30

    Re: to view pdf/ps in chrome/firefox edit mozplugger configuration

    @r.stiltskin Thanks! you saved my day!

  6. #6
    Join Date
    Jan 2011
    Beans
    10
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Viewing pdf files in chromium-browser

    This totally just saved me from a professor who seems determined to screw anyone not using Windows. Thanks for the fix!

  7. #7
    Join Date
    Nov 2006
    Beans
    18

    Re: Viewing pdf files in chromium-browser

    thanks, this helped.

  8. #8
    Join Date
    Oct 2011
    Beans
    1

    Re: Viewing pdf files in chromium-browser

    Really helpfull.

    Thanks for your effort

  9. #9
    Join Date
    May 2011
    Beans
    3

    Re: to view pdf/ps in chrome/firefox edit mozplugger configuration

    Can someone confirm if that is working in 11.10 with Unity?

    Can't get it embed, pdfs open in it's own evince window

    (and yes I have needs_xembed in options, same mozpluggerrc worked fine in gentoo)
    Last edited by zgrge; January 9th, 2012 at 08:00 PM.

  10. #10
    Join Date
    May 2011
    Beans
    3

    Re: to view pdf/ps in chrome/firefox edit mozplugger configuration

    bump

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •