Score:1

how to set default media (paper size) for a printer using lpoptions

sd flag

I want lp to print to a default printer and can set this using lpoptions -d , but I can't find a way to set the default media size. Is there any way to do this with some lp... command or do I need to edit some config file?

ar flag
Which version of Ubuntu are you using? If you are not using Ubuntu indicate the distro of Linux as well. Please provide all these information by [editing your question](https://askubuntu.com/posts/1354384/edit).
Score:0
ly flag

Just an update you can change the page size on default for all the printers by going to /etc/papersize

Score:0
br flag

Suppose DESTINATION is the name of a print queue (as shown, for example, in a print dialog). Obtain a list of printer specific options and their current settings with lpoptopns -p DESTINATION -l. It will contain a section for PageSize.

Let's say you want A4 as the default media size. Do lpoptopns -p DESTINATION -o PageSize=A4.

(Now read the lpoptions manual - man lpoptions).

ar flag
You may also use the `papersize` command. See `man papersize`.
br flag
The `papersize` command affects _all_ printers and also requires root privileges. Changing PageSize on a job-by-job basis is easily done with `lp -p DESTINATION -o PageSize JOB`.
user889030 avatar
cn flag
there is typo : `lpoptions -p DESTINATION -o PageSize=A4`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.