Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing two A5 pages to A4

48 views
Skip to first unread message

Gerhard Trummer

unread,
May 4, 2012, 12:29:13 PM5/4/12
to
Hi,

I'm trying to print two A5 pages to A4 sheet (landscape), but it doesn't
work as expected. Here is my test source:

$ cat a5.ps
%!PS-Adobe-3.0
%%BoundingBox: 0 0 420 595
%%Creator: GNU Emacs
%%Pages: 8
%%EndComments

%%BeginProlog
<< /PageSize [420 595] >> setpagedevice
/SetFont {/Helvetica-Bold findfont 288 scalefont setfont} def
/Frame {
1 1 moveto 418 0 rlineto
0 593 rlineto
-418 0 rlineto
closepath stroke
} def
%%EndProlog

%%Page: 1 1
Frame
SetFont 72 72 moveto (1) show
showpage

%%Page: 2 2
/Helvetica-Bold findfont 288 scalefont setfont
Frame
SetFont 72 72 moveto (2) show
showpage

%%Page: 3 3
/Helvetica-Bold findfont 288 scalefont setfont
Frame
SetFont 72 72 moveto (3) show
showpage

%%Page: 4 4
/Helvetica-Bold findfont 288 scalefont setfont
Frame
SetFont 72 72 moveto (4) show
showpage

%%Page: 5 5
/Helvetica-Bold findfont 288 scalefont setfont
Frame
SetFont 72 72 moveto (5) show
showpage

%%Page: 6 6
/Helvetica-Bold findfont 288 scalefont setfont
Frame
SetFont 72 72 moveto (6) show
showpage

%%Page: 7 7
/Helvetica-Bold findfont 288 scalefont setfont
Frame
SetFont 72 72 moveto (7) show
showpage

%%Page: 8 8
/Helvetica-Bold findfont 288 scalefont setfont
Frame
SetFont 72 72 moveto (8) show
showpage

%%EOF

It produces 8 pages A5 and is displayed as expected. But if I try to
print it:

$ lpr -P PDF -o "number-up=2 number-up-layout=lrtb page-set=odd" a5.ps

The media is A4 and landscape, but the two A5 pages are to small. It
seems Ghostscript thinks the original format is A4 not A5. I suppose my
source is wrong, but I can't figure out why.

What I really want to achieve is to produce the following output with a
small script:

| 1 3 | 5 7 |
| 8 6 | 4 2 |

in two batches, because my inkjet has no duplex printing and I'd like to
print two A5 pages (double-sided) on one A4 sheet and cut the pages in
half in the end. I use CUPS 1.5.2 and Ghostscript 9.05 on Linux. Can
anybody give me a clue?


G.

Helge Blischke

unread,
May 4, 2012, 2:44:32 PM5/4/12
to
I assume you are using CUPS as the print spooler.
printing with the number-up option is implemented by scaling down the pages
to be printed, i.e. with number-up=2, the pages are scaled down by sqrt(2).

To get your problem solved, you have two choices:
(1) set up your pages for A4 size and - if needed - make sure to print full
bleed.
(2) program your imposition in PostScript (which is much mor an effort).

Helge

Gerhard Trummer

unread,
May 5, 2012, 2:05:21 AM5/5/12
to
> To get your problem solved, you have two choices:
> (1) set up your pages for A4 size and - if needed - make sure to print full
> bleed.
> (2) program your imposition in PostScript (which is much mor an effort).

Your second suggestion was my first idea before posting my question. But
according to `5001.DSC_Spec.pdf' on page 7:

»Use of the document structuring conventions not only helps assure that
a document is device independent, it allows PostScript language programs
to communicate their document structure and printing requirements to
document managers in a way that does not affect the PostScript language
page description.«

It's quite easy to do something like this:

/Pages 8 def
Pages {
...
} repeat

But then I loose the ability to place the corresponding `%%Page:'
comments within my PostScript program. I need an external script (e.g.
bash) for this task. Also the setting of `/PageSize' in my program
contradicts *device independence*. That's why I thought CUPS should be
the document manager. But besides the problem with the page size, CUPS
also can not deliver the intended sequence of pages (or I missed something).

Maybe I should give `psutils' a try...


G.

Gerhard Trummer

unread,
May 7, 2012, 7:04:57 PM5/7/12
to
> Maybe I should give `psutils' a try...

This does exactly what I want (if correct DSC are provided and page
descriptions are independent from each other as mentioned in my first
posting):

# Index 0 1 2 3 4 5 6 7
# Page 1 2 3 4 5 6 7 8
# Block |-----1-----|-----2-----|
pstops -q 4:3L(21cm,0)+1L(21cm,14.85cm) a5.ps | lp -s
pstops -q 4:-0L(21cm,0)+-2L(21cm,14.85cm) a5.ps | lp -s

0 new messages