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

Change paper size

54 views
Skip to first unread message

Steve

unread,
Oct 21, 2015, 8:02:17 AM10/21/15
to
Hi,

I have an HP 2550 PostScript printer. I recently wanted to use
legal paper in the manual feed to increase the size of an object
being printed to be cut out and folded. Just feeding it the
larger paper did not work. I went to the Hewlett Packard site
and got the Printer Job Language documents and succeeded in
changing the print area to legal from letter size. I am wondering
what would be required for another brand of printer? Looking at
the PostScript Language Reference Manual did not show an easy
way to do it at first glance. There was mention of changing
entries in a dictionary, but that looked complex.

TIA,

Steve N.

Mark Carroll

unread,
Oct 21, 2015, 8:30:13 AM10/21/15
to
Bo...@Embarq.com (Steve) writes:
(snip)
> I went to the Hewlett Packard site
> and got the Printer Job Language documents and succeeded in
> changing the print area to legal from letter size. I am wondering
> what would be required for another brand of printer? Looking at
> the PostScript Language Reference Manual did not show an easy
> way to do it at first glance. There was mention of changing
> entries in a dictionary, but that looked complex.
(snip)

At the PostScript level I use,

/in { 72 mul } def

/width 8.5 in def
/height 14 in def

<< /PageSize [ width height ] >> setpagedevice

Of course, if your PostScript is being processed by something, it never
hurts to make sure the generated DSC comments match: look for any lines
starting %% with "PaperSize" somewhere in them.

-- Mark

Michael Unger

unread,
Oct 21, 2015, 11:33:26 AM10/21/15
to
I'm not quite sure if I'm understanding your problem correctly ...

In my own PostScript files there is a statement like

| << /PageSize [595.3 841.9]
| >> setpagedevice

at the very beginning, defining the current page size ("ISO A4",
portrait orientation, in this case).

If you want to enlarge the page content as well you'll have to include a
"scale" (and perhaps a "rotate") command at the beginning.

Michael

--
Real names enhance the probability of getting real answers.
My e-mail account at DECUS Munich is no longer valid.

Steve

unread,
Oct 21, 2015, 1:17:06 PM10/21/15
to
Hi,

Michael Unger <spam.t...@spamgourmet.com> writes:

>I'm not quite sure if I'm understanding your problem correctly ...
>
>In my own PostScript files there is a statement like
>
>| << /PageSize [595.3 841.9]
>| >> setpagedevice
>
>at the very beginning, defining the current page size ("ISO A4",
>portrait orientation, in this case).

Thank you and Mark. Using HP's Printer Control Language
seemed both brand specific and clunky. I wanted a better
way to change paper size. You both suggested the same method
to use PostScript to do that. That should work on a different
brand of printer, which is what I wanted. That it looks better
is a bonus.

Regards,

Steve N.

jdaw1

unread,
Oct 21, 2015, 6:20:15 PM10/21/15
to
The following is slightly more pedantic about A4.

/PageHeight 90000 127 div 2 sqrt sqrt mul def
/PageWidth 90000 127 div 2 sqrt sqrt div def
<< /PageSize [PageWidth PageHeight] >> setpagedevice

Or, more concisely and efficiently but less clearly:

<< /PageSize [90000 127 div 2 sqrt sqrt 2 copy div 3 1 roll mul] >> setpagedevice

luser- -droog

unread,
Oct 29, 2015, 9:16:03 PM10/29/15
to
Last time I had reason to define paper sizes, I did it like this.

/in {72 mul} bind def
/cm {in 2.54 div} def
/mm {cm 10 div} def

/A0 [ 841 mm 1189 mm ] def
/A1 A0 aload pop 2 div exch 2 array astore def
/A2 A1 aload pop 2 div exch 2 array astore def
/A3 A2 aload pop 2 div exch 2 array astore def
/A4 A3 aload pop 2 div exch 2 array astore def
/A5 A4 aload pop 2 div exch 2 array astore def
/letter [ 8.5 in 11 in ] def
/legal [ 8.5 in 14 in ] def
/tabloid [ 11 in 17 in ] def

Michael Unger

unread,
Oct 30, 2015, 10:44:49 AM10/30/15
to
On 2015-10-30 02:16, "luser- -droog" wrote:

> [...]
>
> /A0 [ 841 mm 1189 mm ] def
> /A1 A0 aload pop 2 div exch 2 array astore def
> /A2 A1 aload pop 2 div exch 2 array astore def
> /A3 A2 aload pop 2 div exch 2 array astore def
> /A4 A3 aload pop 2 div exch 2 array astore def
> /A5 A4 aload pop 2 div exch 2 array astore def

That's incorrect -- the standardized height and width of the paper
formats is a _rounded_ number of millimeters.

> [...]

Of course the official ISO standard isn't free (CHF 58, 9 pages).

Michael


[1] <https://en.wikipedia.org/wiki/ISO_216>
[2] <http://www.cl.cam.ac.uk/~mgk25/iso-paper.html>
[3]
<http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=36631>

jdaw1

unread,
Oct 31, 2015, 5:55:02 AM10/31/15
to
> That's incorrect -- the standardized height and width of the paper
> formats is a _rounded_ number of millimeters.

Thank you. I will fix my code.

jdaw1

unread,
Oct 31, 2015, 7:35:07 AM10/31/15
to
> That's incorrect -- the standardized height and width of the paper
> formats is a _rounded_ number of millimeters.

Thank you. I have fixed my code.

Antti Louko

unread,
Oct 31, 2015, 9:39:02 AM10/31/15
to
How about this:

mark
2 sqrt
dup sqrt
(A#)
dup 1 1 getinterval
1000 25.4 div 72 mul
0 1 6 {
2 index cvs pop
0 index 4 index mul cvi
1 index 5 index div cvi
2 array astore
3 index cvn exch def
4 index div
} for
cleartomark


Lawrence D’Oliveiro

unread,
Jun 4, 2016, 2:18:27 AM6/4/16
to
On Saturday, October 31, 2015 at 3:44:49 AM UTC+13, Michael Unger wrote:
> That's incorrect -- the standardized height and width of the paper
> formats is a _rounded_ number of millimeters.

Given the realities of the properties of paper, do you really expect to notice any difference?
0 new messages