LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 06-15-2015, 06:03 PM   #1
jjscott
Member
 
Registered: Dec 2012
Posts: 33

Rep: Reputation: Disabled
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
 
Old 06-17-2015, 06:00 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,471

Rep: Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800
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
 
Old 06-17-2015, 08:57 AM   #3
jjscott
Member
 
Registered: Dec 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-17-2015, 10:45 AM   #4
jjscott
Member
 
Registered: Dec 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-17-2015, 03:50 PM   #5
jjscott
Member
 
Registered: Dec 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-17-2015, 05:53 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,647

Rep: Reputation: 2655Reputation: 2655Reputation: 2655Reputation: 2655Reputation: 2655Reputation: 2655Reputation: 2655Reputation: 2655Reputation: 2655Reputation: 2655Reputation: 2655
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.
 
Old 06-18-2015, 05:27 AM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,471

Rep: Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800
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.
 
Old 06-18-2015, 08:25 AM   #8
jjscott
Member
 
Registered: Dec 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-18-2015, 10:15 AM   #9
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,471

Rep: Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800Reputation: 2800
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues printing in landscape mode - CentOS v6.6 jjscott CentOS 1 02-06-2015 03:33 AM
Printing PDF files in landscape sampappachan_nyc Linux - Server 1 04-21-2010 07:13 PM
printing landscape pdf Caysho Linux - Newbie 2 01-22-2004 05:26 AM
printing pdf from konqueror browser mike@wales Linux - Software 0 07-12-2003 10:06 AM
how to set proper pdf plugin in mozzila browser bajaj Linux - Software 0 07-04-2003 06:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration