Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-15-2015, 06:03 PM
|
#1
|
Member
Registered: Dec 2012
Posts: 33
Rep:
|
Browser PDF plugin for CentOS v6.6 - Landscape printing issue
I am looking for a solution for landscape printing within Firefox on CentOS v6.6 - 64 bit. I have been told that landscape printing was broken in the version of CUPS distributed with CentOS v6.6 and was subsequently fixed in v7.0. Unfortunately, upgrading to 7.0 is not an option for us due to limitation of a third party software application. We simply cannot upgrade to CentOS v7.x or revert to the 32 bit version of 6.6.
Our business need is to correctly print both landscape & portrait PDF document from within Firefox. I don’t want to launch a separate window for Okular or Adobe and have to download the document to the hard drive and then print it.
I know that Firefox has a built in PDF viewer that allows you to open the PDF’s within the Firefox browser and print them. It appears that it basically dumps the print job to CUPS and allows it to format the document and send it to the printer. As such, documents formatted for landscape do not print correctly. They always print in portrait.
I tried installing Adobe v9.3 and then v9.5 along with their plugin, but have not experienced what I would call stable results. My test involved installing Adobe under the 32 & 64 bit versions of Firefox v38. What I found for all tests is that Adobe takes care of rendering the document properly so that landscape and portrait documents print correctly, but when attempting to open any PDF the first time after starting Firefox yields a blank screen instead of the PDF. All subsequent PDF’s open fine. If I restart Firefox, I get the same results. I have been told by others at my company that we had the same problem with our current system back in 2011. Our current system is running the 32 bit version of CentOS v5.6 with Firefox v10. To correct the issue, they removed nspluginwrapper. I tried this on the 32 bit Firefox v38 with Adobe v9.3 and it did not work. I still get a blank screen when attempting to open the first PDF.
I found source for a PDF plugin for Okular, but unfortunately, it requires kdelibs version 5 and CentOS 6 used version 4. Seems like a bit of a rabbit hole to try and retro fit this.
I installed Chrome as a test. It also has a built in PDF view, but it doesn’t render the document for printing. Landscape prints as portrait.
So, does anyone have any suggestions on how to get PDF’s to print correctly from within Firefox? Pretty please? This is really killing me!!!
Thanks
|
|
|
06-17-2015, 06:00 AM
|
#2
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,471
|
You have not mentioned the printer that is in use, but I found that I needed to patch the print filter to get landscape printing to work correctly.
http://www.linuxquestions.org/questi...ml#post5306852
|
|
|
06-17-2015, 08:57 AM
|
#3
|
Member
Registered: Dec 2012
Posts: 33
Original Poster
Rep:
|
Sorry about that. We are using a Brother MFC-J6520DW. I'm going to try the changes to psconvertij2 that Allend outlined in his post.
Thanks for the feedback. Will reply with the results.
|
|
|
06-17-2015, 10:45 AM
|
#4
|
Member
Registered: Dec 2012
Posts: 33
Original Poster
Rep:
|
I patched my psconvertij2 file with what allend did and it kind of works. I have a two page document that is formatted for landscape and it does print the two pages correctly (landscape). However, it also prints two additional pages of the same document in portrait. The document on the last two are centered in the middle of the page and the right side of the report is cut off.
Here is what I inserted into my psconvertij2 file.
+# adjust for landscape orientation if necessary
+if [ "$(awk '/^%DocumentMedia:/ {if ($3 > $4) print "3"}' $TEMP)" = "3" ] ; then
+ sed 's:>> setpagedevice$: /Orientation 3&:' $TEMP | \
+ exec $GHOST_SCRIPT -r$RESOLUTION -g${HEIGHT}x${WIDTH} $GHOST_OPT
+else
+ cat $TEMP | exec $GHOST_SCRIPT -r$RESOLUTION -g${WIDTH}x${HEIGHT} $GHOST_OPT
+fi
I am going to respond to Allend's thread and see if he can help
Thanks
|
|
|
06-17-2015, 03:50 PM
|
#5
|
Member
Registered: Dec 2012
Posts: 33
Original Poster
Rep:
|
Sorry, I just realized that you are allend. Goes to show how my day is going. Here is the response I posted in the other thread to you. I will stop posting to that thread and continue our dialog in this one.
I have the same problem printing landscape documents. I am running CentOS 6.6 with Firefox 31. I have a Brother MFC-J6520DW. I am allowing Firefox to open the PDF's within the browser. There is a setting in Firefox for opening PDF's and it is set to "Preview in Firefox".
I added your code to my psconvertij2 file and it kind of works. I have a two page document that is formatted for landscape and it does print the two pages correctly (landscape). However, it also prints two additional pages of the same document in portrait. The document on the last two are centered in the middle of the page and the right side of the report is cut off. I had to select "Landscape" as the Orientation under Page Setup. If I left it as portrait, it prints it in portrait, but condenses everything to fit the page, which almost makes it unreadable. In this scenario, it does not print the two additional pages.
This is what I added to the bottom of my psconvertij2 file just above the rm $TEMP line.
+# adjust for landscape orientation if necessary
+if [ "$(awk '/^%DocumentMedia:/ {if ($3 > $4) print "3"}' $TEMP)" = "3" ] ; then
+ sed 's:>> setpagedevice$: /Orientation 3&:' $TEMP | \
+ exec $GHOST_SCRIPT -r$RESOLUTION -g${HEIGHT}x${WIDTH} $GHOST_OPT
+else
+ cat $TEMP | exec $GHOST_SCRIPT -r$RESOLUTION -g${WIDTH}x${HEIGHT} $GHOST_OPT
+fi
Do you have any idea's?
Thanks
|
|
|
06-17-2015, 05:53 PM
|
#6
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,647
|
unfortunately i have not had this issue on ScientificLinux 6.6
the current Evince
or
the current Firefox 38
-- screenshots of "print preview"
( desktop background image "tiff2pdf " )
Evince
http://imgbox.com/dUPI2sKc
firefox
http://imgbox.com/cCRYtSrb
and Gimp also prints in landscape
current 6.6 cups-1.4.2 and a HP printer
Last edited by John VV; 06-17-2015 at 05:56 PM.
|
|
|
06-18-2015, 05:27 AM
|
#7
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,471
|
Firstly, when you added the code, did you remove the + from the start of lines? The listing you took the code from was actually a diff listing.
Second, is your print filter script written for a Bourne shell, or is it a PERL script?
As John VV points out, this appears to be a printer specific issue, that may be occurring in a number of print filters supplied by Brother.
|
|
|
06-18-2015, 08:25 AM
|
#8
|
Member
Registered: Dec 2012
Posts: 33
Original Poster
Rep:
|
Thanks for responding.
Yes, I removed the + from the start of the lines.
There are three files under /opt/brother/Printers/mfcj6520dw/lpd...psconvertij2, filtermfcj6520dw and brmfcj6520dwfilter.
The psconvertij2 and filtermfcj6520dw both contain #!/bin/sh at the top of the file, so I assume they are Bourne scripts.
The brmfcj6520dwfilter file is compiled code.
Can you help me tweak them to get landscape printing working?
Thanks again
|
|
|
06-18-2015, 10:15 AM
|
#9
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,471
|
My apologies for being simplistic.
Quote:
I added your code to my psconvertij2 file and it kind of works. I have a two page document that is formatted for landscape and it does print the two pages correctly (landscape).
|
That suggests that the print filter is working.
Quote:
However, it also prints two additional pages of the same document in portrait. The document on the last two are centered in the middle of the page and the right side of the report is cut off.
|
That suggests an additional input that is bypassing the print filter.
Quote:
I had to select "Landscape" as the Orientation under Page Setup. If I left it as portrait, it prints it in portrait, but condenses everything to fit the page, which almost makes it unreadable. In this scenario, it does not print the two additional pages.
|
The application does also play a part.
|
|
|
All times are GMT -5. The time now is 12:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|