[Desktop_printing] PageSize vs PageRegion?

Kurt Pfeifle k1pfeifle at gmx.net
Tue Mar 7 08:21:20 PST 2006


On Tuesday 07 March 2006 13:43, Alexander Larsson wrote:
> I'm working on the Gtk+ print dialog, and I have a question about
> PageSize and PageRegion.

It continues to confuse me, even after years of being exposed to 
these keywords. Let's see if I can remember correctly (don't have
the PPD specs around here right now):

* PageRegion is meant to be used for describing the imageable area
  on a sheet that is fed from the "manual tray". (And the manual
  tray is mean to be able to grokk very weird paper sizes, not
  fitting into any of the predefined ones...).

* PageSize is meant to select a specific page size as is defined
  in the PPD by *name*. (Internally, PageSize is also an *invocation* 
  to the physical printer to use an appropriate input slot and 
  reserve an amount of memory in its interpreter to hold the image 
  that will go to the

> I'm not sure when and how to use these.

Ha!, there are even more "keywords" to be aware of, and which play
their role in media selection: ImageableArea, PageSize, InputSlot,
PaperDimension, MediaType, MediaColor, MediaWeight,...

Some of these, as well as their finely grained differences are more 
important for correctly *authoring* PPD files than for presenting 
their contents to the user GUI, though. (For the GUI, and for the
user to take his picks, only the contents of "*OpenUI....*CloseUi"
sections of the PPD are important.)

The ImageableArea is important in so far as it may describe a hard
physical limit of the marking engine (which may be unable to print
from paper edge to paper edge), and thusly should prevent/warn the
application user if she designs a document that violates these limits;
and/or the PostScript creation process should take care of these
limits too.

MediaType is a way to select a specific medium (like "transparency",
or "letterhead") without the user having to know which specific tray 
holds that medium. This option definitely needs correct setup on the 
device side first, before it is working correctly -- but once set
up, I'd expect it to work from the GUI.

MediaColor and MediaWeight are used similarly as MediaType (to select
by color or by weight without knowing the actual slot); they also 
need prior device setup. (Of course, MediaType, MediaColor and 
MediaWeight keywords are present in only very few PPDs).

PaperDimension defines a paper by *size* (2 values: width and height),
as opposed to by *name* (like "A4" or "Letter").

About InputSlot, see below...

> Reading  
> the PPD spec it seems like you're supposed to use PageSize if the user
> wants a specific page size, and doesn't care from where it comes, and
> PageRegion if the user specifies a specific InputSlot (and
> RequiresPageRegion for that slot is true).

PageRegion is for the input slot named as "ManualFeed".
 
> However, I'm representing InputSlot as a dropdown selection in the UI,
> which means that InputSlot is always set (typically to its default
> value). In most use cases I think the user just wants to pick a page
> size though. In these cases we should ignore the InputSlot and use
> PageSize. 

You can't "ignore" InputSlot selections. InputSlot and PageSize are
two entirely different things. To give a few example data points:

* Most HP LaserJets for workgroups (as well as most other vendors'
  equipment) are extensible, and you can add several InputSlots to 
  them by stacking an additional paper tray unit underneath the 
  marking engine unit.

* These printers then may have up to 10 or more input trays; and 
  each input tray may have flexible guides, that allow loading of
  different paper sizes (A5, A4, A3, Legal, Letter...).

* Physical printers may or may not have a "media size autosensing"
  capability; humans may or may not have to "tell" the printer the
  mapping of "A4 size is in tray 1, A5 in tray2, and A3 in tray3".

* You may have 10 trays, each one with white Letter paper; selecting
  a specific slot may not be of any relevance.

* You may have 4 trays with different sizes or different paper 
  colors (or letterhead forms), and a user may specifically select
  one slot specifically to really get the red A3 sheet to print on.

* PageSize determines how the print "image" is to be sized for each
  sheet; it is a parameter that the PostScript generating program
  very often wants to be made aware of *before* it generates the 
  (PS) printfile. (Here the "ImageableArea" value is also to be
  considered).

* Usually, users of such printers know (or are told by their admins)
  which slot holds which paper type.

* Some printers will print if "PageSize=A3" and "InputSlot=tray3" 
  is selected even if "tray3" feeds only a A5 paper size (resulting
  in an "overflowing" image on the sheet); some printers will reject
  the job and display an error message on their front panel display, 
  or ask for changing tray or load a different paper size.

> The obvious way to handle this would be to have an "automatic" choice
> for InputSlot and use PageSize when that is set. I've been looking at
> various existing ppds it looks like some have "Auto" or "AutoSelect"
> choices. Is this something i can rely on?

Unfortunately, this is not always implemented correctly in some of
the "professional" laser printers as are used in enterprises...

"Autoselect" choices are meant to give the physical printer the 
freedom to switch paper trays which are loaded with paper of equal 
sizes "on the fly" (if the first one in use is running out of paper 
in the middle of the job). You either make sure that all A4 trays 
of the printer are loaded with paper of the same white color, or 
you don't care if the paper color changes in the middle of the job 
from yellow to red since the yellow one was used up.

Pinning a paper tray (using any tray specifically, but *not* 
letting the printer do "autoselect") by explicitely choosing it
will let the printer stop once that tray is empty (even if it has
5 other trays with the same sizes loaded).

Cheers,
Kurt




More information about the Printing-summit mailing list