[cups.general] Fixing the page-label option
Johannes Meixner
jsmeix at suse.de
Wed Sep 29 04:07:53 PDT 2010
Hello,
On Sep 28 09:40 Michael Sweet wrote (shortened):
> On Sep 28, 2010, at 9:12 AM, Tim Waugh wrote:
>> It's well-known¹ that the page-label option does not work correctly in a
>> variety of situations, and that its behaviour not well-defined².
>>
>> Specifically, no version of CUPS correctly (or, at least, consistently)
>> place page labels on all combinations of PostScript-vs-PDF input and
>> portrait-vs-landscape orientation. Most commonly incorrect is the
>> placement of page labels for landscape PDF input³.
....
>> ¹ http://cups.org/str.php?L3414
>> ² http://cups.org/str.php?L3563
>> ³ http://cups.org/str.php?L3334
....
>> Why is the PageOrientation comment not sufficient to determine the
>> orientation of a given document page?
>
> Because that comment is provided for viewing applications to know the
> desired viewing orientation, not the orientation of the page itself
> which may be pre-rotated or have a landscape size specification,
> which need to be addressed differently when applying the page label.
The more often I read the Adobe DSC specification regarding
"%%Orientation" (page 43)
------------------------------------------------------------------
A portrait orentation indicates that the longest edge of the
paper is parallel to the vertical (y) axis. A landscape
orentation indicates that the longest edge of the paper
is parallel to the horizontal (x) axis.
------------------------------------------------------------------
the more I get confused about what this should actually mean.
Assume the content of a page has
%%BoundingBox 10 15 580 780
it means the content is from left 10 to right 580 on the x axis
and from bottom 15 to top 780 on the y axis.
To place this content "inside" of a A4 (width 595, height 842)
or Letter (width 612, height 792) paper, the longest edge
of the paper must be parallel to the vertical (y) axis so that
%%Orientation Portrait
seems to be mandatory in this case according to what the Adobe DSC
specification reads.
Accordingly if the content of a page has
%%BoundingBox 15 10 780 580
the only possible value seems to be
%%Orientation Landscape
to place this content "inside" of a A4 or Letter paper.
But then the %%Orientation value would be useless (i.e. would not
provide any new information) because it would be already strictly
determined by the %%BoundingBox values.
If the %%Orientation value was not meant as a somewhat redundant
but actually useless information, I wonder what
%%BoundingBox 10 15 580 780
%%Orientation Landscape
and
%%BoundingBox 15 10 780 580
%%Orientation Portrait
should actually mean?
The only meaning which seems to make sense for me at the moment is:
Use the %%BoundingBox values to place the content "inside"
of the paper but use the %%Orientation value to find out
how a user would orientate the printed paper in front
of his face to view the content.
Therefore
%%BoundingBox 10 15 580 780
%%Orientation Landscape
means:
the user would orientate the printed paper so that the longest edge
of the paper is horizontal
and
%%BoundingBox 15 10 780 580
%%Orientation Portrait
means:
the user would orientate the printed paper so that the longest edge
of the paper is vertical.
I.e. I ignore now that the Adobe DSC specification reads about "axis"
which makes sense only regarding the PostScript coordinate system.
Examples:
Assume one big capital letter 'L' should be printed.
If the PostScript content is (ASCII fixed-font-size graphics):
#
#
#
###
or
###
#
#
#
the DSC comments must be like
%%BoundingBox 10 15 580 780
%%Orientation Portrait
If the PostScript content is (ASCII fixed-font-size graphics):
######
#
or
#
#####
the DSC comments must be like
%%BoundingBox 15 10 780 580
%%Orientation Portrait
Assume one big small letter 'm' should be printed.
If the PostScript content is (ASCII fixed-font-size graphics):
#######
# # #
or
# # #
#######
the DSC comments must be like
%%BoundingBox 15 10 780 580
%%Orientation Landscape
If the PostScript content is (ASCII fixed-font-size graphics):
###
#
###
#
###
or
###
#
###
#
###
the DSC comments must be like
%%BoundingBox 10 15 580 780
%%Orientation Landscape
The last example shows how the %%Orientation value indicates
that the PostScript content means a big small letter 'm'
and not a big capital letter 'E'.
The examples also show that %%Orientation values like "Seascape"
and "UpsideDown" are missing.
According to my examples it seems by using %%Orientation it is possible
to find out if a page-label should be placed along one of the long edges
of the paper (in case of %%Orientation Landscape) or along one of the
short edges of the paper (for %%Orientation Portrait).
Or do I confuse something here?
Kind Regards
Johannes Meixner
--
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex
More information about the cups
mailing list