How to set default page orientation in Okular for printing
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
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.
How to set default page orientation in Okular for printing
Is there a way to change the default page orientation for printing documents in Okular? What I am seeing is that Okular is auto-detecting the page orientation and I need it to always default to portrait regardless if it the document is landscape or portrait.
I am running CentOS 6.6 with KDE & a Brother MCFJ6520DW printer.
I have tried running system-config-printer and selecting the properties of the printer and changing the orientation from “Automatic Rotation” to “Portrait (no rotation)”, but it still auto-detects the document type and sets the orientation accordingly. Every time I want to print a landscape document, I have to select File, Print and then the Properties button next to the Brother printer, and set the orientation to Portrait.
Is there a way to change the default page orientation for printing documents in Okular?
IIRC, it can be set on a per-document basis. For example, if you open foo.pdf and rotate the pages via View > Orienatation > ... then Okular records this in ~/.kde4/share/apps/okular/docdata/foo.pdf.xml
When you go to print, it reads this file and sets landscape or portrait accordingly, although you can then override this in the print dialogue. Now, how this actually prints in practice is where things may not occur as expected. The CUPS printing workflow could well be impacting here. There are numerous bug reports describing landscape/portrait printing issues, and it can be a confusing picture to understand where things are deviating from expected behaviour, (especially with respect to page orientation).
I have tried running system-config-printer and selecting the properties of the printer and changing the orientation from Automatic Rotation to Portrait (no rotation), but it still auto-detects the document type and sets the orientation accordingly. Every time I want to print a landscape document, I have to select File, Print and then the Properties button next to the Brother printer, and set the orientation to Portrait.
Just a thought - When you made the changes, did you then restart CUPS before testing?
Thanks for the reply, and believe me, I am well aware of the landscape/portrait printing issues with CUPS. PDF's on my system print fine in regard to landscape printing as landscape and portrait printing as portrait. I believe this is because Okular is handling the print formatting before passing it to CUPS.
My challenge is getting Okular to default to portrait for the orientation for all documents when sending the job to the printer. I have 1000 users that access daily generated PDF's from a Firefox web portal and they are not going to like it if they have to select the printer properties and then select portrait for the orientation in order to get it to print landscape properly. Their current system uses Adobe for PDF viewing on the same Firefox portal, and it does not auto detect the page orientation. It defaults to portrait regardless of the document type.
Ironically, most users have had problems with getting landscape printing to work. It reads like some of the documents accessed are not published with typical portrait page layout? Do you have a sample file I can test with? Is it viable to consider alternative PDF viewers (or even browser) to view and print the required PDF files?
As a test, I've just viewed a standard A4 page and printed, then a landscape letter-sized document (View > Properties reports 279mm x 216mm). In both cases the documents print in portrait mode as expected. The second was scaled to fit (A4 paper) with white space top and bottom also as expected. For reference, I'm using KDE version 4.14.10, Okular version 0.21.3
When working with landscape pdf, chosing landscape when printing actually prints the document in portrait. Chosing portrait prints the document in landscape.
I think that the portrait/landscape setting in the printing window actually is more like a rotate command: portrait leaves the document alone while landscape rotates it by 90 degrees. This is not always correct, obvioulsy in my case it's not.
Okular I used is from the latest RC debian packages, running on Ubuntu Intrepid.
You might be able to force portrait orientation by using adding the following entry to /etc/cups/printers.conf (within the applicable printer definition)
Code:
Options orientation-requested 3
The values are as follows
Code:
The -o orientation-requested=N option rotates the page depending on the value of N:
-o orientation-requested=3 - portrait orientation (no rotation)
-o orientation-requested=4 - landscape orientation (90 degrees)
-o orientation-requested=5 - reverse landscape or seascape orientation (270 degrees)
-o orientation-requested=6 - reverse portrait or upside-down orientation (180 degrees)
It can be configured by editing printers.conf directly or via
My doc. display on screen in Portrait format, but print in Landscape format using Print command from File menu. However, when I print directly from Print icon on toolbar, they print in Portrait format.
I checked File Menu - Page Preview - which shows document in Portrait format.
I also checked View Menu - Page Layout - which shows document in Landscape format.
What's going on?
My doc. display on screen in Portrait format, but print in Landscape format using Print command from File menu. However, when I print directly from Print icon on toolbar, they print in Portrait format.
I checked File Menu - Page Preview - which shows document in Portrait format.
I also checked View Menu - Page Layout - which shows document in Landscape format.
What's going on?
What software are you using? My version of Okular doesn't have View->Page Layout.
If it isn't Okular that you're using, can you please start a new thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.