Showing posts with label Evince. Show all posts
Showing posts with label Evince. Show all posts

Tuesday, July 3, 2018

Document viewer Evince in Fedora does not print page borders? Here is a solution!

Well, this is not a workaround or a solution available in Evince, but this is a general solution which can be used when the usual GUI applications does not have some features. 

Today I was trying to print some lecture slides using "Document Viewer" also known as "Evince" running on my Fedora laptop. I was trying to print several pages in one output page. (4 lecture slides should be printed on a single page)

Once I got the output, I realized that it does not add a border to source pages printed on a single output page. I couldn't find an option in Evince to get that done.

Fortunately I came across about the Unix/Linux lp command which uses CUPS. (Common UNIX Printing System)
Using that I was able to get what I wanted printed precisely.

Here are the steps,

1. Find out the status of the printers you have configured in the system,

lpstat -a

This will list down all the printers you have configured in your machine. Use the preferred printer as the destination of the lp command using -d option. (see the next step)

2. Use lp command to get the job done

lp -d HP-LaserJet-400 -o sides=two-sided-short-edge -o number-up=4 -o pagesize=A4 -o landscape -o page-border=single -o fit-to-page -o number-up-layout=lrtb my_document.pdf

As you can see, we can pass multiple options to lp command including the page-border which I couldn't find in Evince. You can find the explanations of each option in lp man page.

Another great option of lp is that you can send multiple files to printer.
e.g.: if you want to print all the files which have file names starting from "bla_" then you can pass bla_* to lp command so that all of them will be printed one by one.