LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


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

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

I don’t see any options in CUPS for orientation.

Any ideas how to change this behavior?
 
Old 07-25-2015, 08:19 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,775

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Quote:
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).

For example
https://bugzilla.redhat.com/show_bug.cgi?id=768811#c34

You might try printing from the CLI in an effort to discover if you can get a .pdf printed with the desired page orientation.

Get the printer name
Code:
lpstat -a
and send print job specifying portrait mode
Code:
lpr -P <printer-name> -o portrait /path/to/foo.pdf
Does that print the .pdf as expected?

Quote:
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?
 
Old 07-26-2015, 07:02 AM   #3
jjscott
Member
 
Registered: Dec 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
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.
 
Old 07-26-2015, 03:37 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,775

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
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?
 
Old 07-26-2015, 11:37 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,775

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
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
 
Old 07-30-2015, 01:01 AM   #6
JenniferPinto
LQ Newbie
 
Registered: Jul 2015
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 11-30-2015, 11:27 PM   #7
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,775

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
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
Code:
lpadmin -p <printer-name> -o orientation-requested-default=3
where <printer-name> is the name of your printer.

CUPS will need to be restarted for it to take effect.
 
Old 07-12-2016, 11:34 AM   #8
ExMds
LQ Newbie
 
Registered: Jul 2016
Posts: 1

Rep: Reputation: Disabled
Smile How to set default page orientation in Okular for printing

Thanks a lot all my friends, i have learned a lot from your replies
 
Old 08-09-2016, 01:33 AM   #9
annacruz1434
LQ Newbie
 
Registered: Aug 2016
Posts: 1

Rep: Reputation: Disabled
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?
 
Old 08-16-2016, 06:48 AM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by annacruz1434 View Post
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.
 
  


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
[SOLVED] printing problems cups okular printing jobs debian squeeze epson stylus sx 410 Foxbat1155 Linux - Newbie 4 02-22-2012 02:49 PM
[SOLVED] how to set okular as default pdf reader after installing adobereader? (KDE4) zyli2006 Slackware 2 10-02-2009 02:33 PM
Scribus and page orientation blotch Linux - Software 4 10-13-2005 02:47 AM
Where do i set draft printing rather than default? blastradius Ubuntu 1 09-20-2005 09:39 AM
In apache, i want to set my default page to be index.html, or something thep Linux - Newbie 3 04-17-2001 02:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:00 AM.

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