Bug 136695

Summary: Remove excessive whitespace when printing
Product: [Applications] okular Reporter: Gabriel Ambuehl <gabriel_ambuehl>
Component: generalAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: wishlist CC: dennis.jansen, pawelk, vito.detullio
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Gabriel Ambuehl 2006-11-02 10:36:28 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages
OS:                Linux

I often print articles from scientific journals. Many of those are latex publications and accordingly rather narrow pages, but very often the PDFs they are in are actually based on A4 or letter sized pages which means there are huge white borders on all sides wasting quite some paper. 

Printing two pages on one sheet usually isn't much of an option as the font size gets too small because of all the borders that are still taking up space. It would however work if the PDF reader somehow cut of all white borders and only used the actual area with text for printing... I'm not entirely sure if it could figure out what to print, but it would be a killer feature for me ;)
Comment 1 Martin Fabian Hohenberg 2006-12-06 13:48:14 UTC
I don't get your point ... what's the reason for enlarging the text part of a scientific journal text (and thus using more ink/toner)? I don't really think you could then put more real "text" on a page...

AFAIC, I really like those "useless" borders for writing annotations and comments  directly beneath the paragraph that spurred them... 
Comment 2 Albert Astals Cid 2007-06-04 12:03:22 UTC
Reassigning to the mailing list
Comment 3 kde2eran 2008-02-06 20:50:09 UTC
See also kpdf bug 115557 about removing useless borders on-screen. Should that bug be duplicated or moved to okular?
Comment 4 Pino Toscano 2008-02-06 20:54:25 UTC
@kde2eran:
if you understand the difference between "screen" and "printing", then the reply is no, they are different.
Comment 5 kde2eran 2008-02-06 22:00:12 UTC
@pino: I asked if bug 115557, on removing borders when *viewing in KPDF*, should be duplicated or reassigned to cover *viewing in Okular*.

By the way, the PDF bounding box can be calculated using
$ ghostscript -DBATCH -DNOPAUSE -DPARANOIDSAFER -DQUIET -sDEVICE=bbox -r15x15 file.pdf
Comment 6 Pino Toscano 2008-02-06 22:16:15 UTC
@kde2eran:
I don't want to mix *KPDF* and *Okular* bugs.

> By the way, the PDF bounding box can be calculated using ...
Portable solution, I see...
Comment 7 kde2eran 2008-02-06 22:21:23 UTC
@pino:

OK, then I'll duplicate that bug for Okular.

Of course running GhostScript is not a solution for Okular, but if someone wants to implements a portable solution, maybe looking at GhostScript's code will help.
Comment 8 Gabriel Ambuehl 2008-02-07 09:13:53 UTC
> By the way, the PDF bounding box can be calculated using
> $ ghostscript -DBATCH -DNOPAUSE -DPARANOIDSAFER -DQUIET -sDEVICE=bbox
> -r15x15 file.pdf


This is what pdfcrop does (in conjunction with LaTeX to rebuild pages). It 
does not work with all PDF though, sometimes it creates a horrible mess...
Comment 9 kde2eran 2008-05-08 17:33:50 UTC
The patch in bug 161599 (on removing borders when *viewing*) has simple code for computing the bounding box by scanning the pixmap for white pixels.
Comment 10 Paweł Kołodziej 2008-11-11 01:24:50 UTC
It will be also useful for me to manually select which part of page is interesting and should be printed (in magazines distributed via PDF there often are some unimportant marks near edges of page).
Comment 11 Vito De Tullio 2008-11-24 18:42:06 UTC
kde2eran: now that we have a "trim" button for *viewing*, it's possible to apply this also to printing? Are the 2 problems so different?
Comment 12 Pino Toscano 2008-11-24 18:54:46 UTC
(In reply to comment #11)
> now that we have a "trim" button for *viewing*, it's possible to
> apply this also to printing?

It is not possible to apply for priting the way used for viewing, sorry.

> Are the 2 problems so different?

Yes.
Comment 13 Pino Toscano 2009-03-18 16:57:07 UTC
*** Bug 187531 has been marked as a duplicate of this bug. ***