-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Page Size Issues #127
Comments
CUPS.org User: mike Re: the order dependency and feature comment issues, those should definitely be fixed. Re: width > height, I find no text on the specified pages that supports that assertation; certainly the spec refers to portrait and landscape pages, however the orientation value is specifically used to rotate the coordinate system (supported by both the text and figures) of the page and therefore is independent of the landscape/portrait appearance of the print. You'll notice that the bottom "roll" of Figure 3 on page 109 shows Height > Width for all four orientation values... Patch to emit.c to follow shortly... |
CUPS.org User: mike I've attached an initial patch for the page comment and also changes to use the ParamCustomPageSize attributes (noticed that they were not being used...) I'm not sure how we'll handle the order dependency issue - the sorting code doesn't have access to the PPD file pointer, so it can't lookup the attribute from it and sort based on that value, only based upon the PageSize option... |
CUPS.org User: david.gelphman Regarding the issue of the width, height and orientation parameters: first look at Figure 3 on page 109. What you see in the bottom of the two diagrams, i.e. the one where Height > Width is that the page image that appears on the roll is a landscape page for orientation zero and a portrait page for orientation 1. Since we are using Height > Width and orientation 0, for PPD code and a device that follows the spec, I would expect a landscape page to result. Since we expect a portrait orientation to be in place after we execute the page size code this produces incorrect results. Now to page 118 and Table 2. If you look at the last bullet item immediately before Table 2 it says: "Unless the print manager lets the user enter Orientation directly, the print manager must deduce the value of Orientation from a combination of user requests, as shown in Table 2." If you are to consult Table 2 you will see that for the case where Height > Width (as we are currently generating) Orientation 0 will produce a landscape document. I am concerned that from my reading of this portion of the PPD spec and the feedback we are getting from some OEMs including Adobe I believe that cups is currently producing incorrect output I'm not 100% clear what the solution is. On the one hand, if we start to follow the spec we may break various printer/PPDs. On the other hand other printer/PPDs don't work correctly with the current code. The one advantage is that by changing to follow the spec we can fix those that already do and force correct conformance by others in turn. |
CUPS.org User: mike OK, let's start from the beginning. From the standpoint of CUPS, all custom pages are portrait orientation, even if width > height (length). If we send a print file with a custom size, the coordinate system originates at the bottom lefthand corner with X increasing to the right and Y increasing to the top. All of the CUPS raster drivers I know of and many of the PPD files we have for PS printers ignore the orientation value that is passed to the CustomPageSize code, so from the CUPS implementation standpoint the only thing we care about is that the default value we send for Orientation (currently 0) is the correct one according to the spec. We do not want the device doing any rotation of the page image for us, we just want a common, neutral coordinate space to image onto. That said, after looking at figure 3 again I'm guessing that the correct orientation value is 1, not 0, but it could also be 3 (the figure is not at all clear which way the paper goes into the printer...) |
CUPS.org User: david.gelphman You are correct: if we supply a WIDTH < HEIGHT then we should be using orientation 1. If we supply a WIDTH > HEIGHT we should be suppling orientation 0. The other orientations are for fancier paper handling and presumably would come from a UI (which we don't have). Note that WIDTH is not necessarily the custom paper width and HEIGHT is not necessarily the custom paper length. A couple of notes:
Now this is the way the spec reads and which Adobe is pressing for. Please do note that I'm not claiming first hand experience of correct results with this approach. I had the a bug in the LW8 code I wrote which, while it was trying to do this, turns out it was not :-( |
CUPS.org User: mike Hmm, I'm not sure that sending the width/height swapped with orientation = 0 is the "right" solution, as we'd then need to rotate the page ourselves. Keep in mind that from our standpoint a custom page size is always "portrait" even when width > length, since "portrait" and "landscape" in CUPS/IPP refer to page image rotation and not the actual media orientation (although that might be how a printer implements it in some situations...) IIRC (and I don't have the PPD spec in front of me right now) the spec specifically states that the printer may or may not actually rotate the page image with different Orientation values. That said, I can't say that I've ever looked for PPD files that limit the Orientation to 0, so I don't know if this will ever be a problem, but I'm just bringing up the issue because I'm still not clear on how providing the wrong width/length will do anything but result in a print that is cut off on one side... |
CUPS.org User: mike I've commited a change to CVS to set Orientation to 1 or 0 as needed, and to range check against the ParamCustomPageSize limits, however I did not swap the width/length if the orientation is limited to a value of 0. Some basic searches through PPD files reveiled that the CUPS sample drivers limit orientation to 0, and they will definitely break if we do any swapping. Also, some basic tests on a DesignJet 3500 (which does support the orientations) shows that swapping the width and length results in a cut-off print, as expected... |
CUPS.org User: mike Note, for CUPS 1.1.21 we will only be using an orientation of 1 unless the PPD file specifies that 1 is not a supported value. The previous code we used had bad side-effects on large-format PS printers, and using an orientation value of 1 seems to work in all cases. |
"str127.patch": Index: emit.cRCS file: /development/cvs/cups/cups/emit.c,v
- }
|
"str127-part2.patch": Index: emit.cRCS file: /development/cvs/cups/cups/emit.c,v
@@ -377,7 +408,8 @@
|
Version: 1.1.19rc5
CUPS.org User: david.gelphman
Michael,
There are a couple of issues that have come up recently regarding custom page size handling.
The first one is that when generating custom page size, cups is treating this as *PageSize Custom and using the order dependency for *PageSize rather than using the NonUIOrderDependency for CustomPageSize. This is causing problem for at least one OEM. I started to look at the code to craft a solution for this but I thought I'd ask if you'd heard about this problem before. As a side note, I've always generated the PS code as
%%BeginFeature *CustomPageSize True
code goes here
%%EndFeature
rather than using the *PageSize Custom as CUPS currently does. I don't think this is a big deal really but I thought I'd mention it. Note that using the order dependency is a real issue that I'll need to resolve at some point.
(As a side note, it is a bit odd that the order dependency for custom paper size is different than that for normal page size for any printer. I've pushed back on our corresponding bug regarding this because I think the straightforward workaround for the manufacturer is to update their PPD so these order dependencies are the same.)
The other problem is that the way the CustomPageSize code is being generated appears to be out of spec with the PPD 4.3 specification (section 5.16 p106 of the PPD spec v4.3). That is not one of the sterling portions of the PPD spec (it is a mess really) but the bottom line is that when generating orientation value of zero, the width must be larger than the height. See figure 3 on page 109 and Table 2 on p118. In the case of orientation 0, if height is > width, this will produce a landscape page. In principle we should be using width > height if we are using orientation zero.
I'm reluctant to simply make this change because it will almost certainly break things for some large number of printers. Defensive PPD code could address this by examining the parameters passed in and adjusting them appropriately.
I'm interested in hearing about your experience and thoughts on this matter. The complaints are coming from a variety of sources and unfortunately because of bugs the implementation in LaserWriter 8 had the same problem. This has lead to a mixture of behavior from incorrect results on properly formed PPDs as well as manufacturers' adjusting their PPDs to non-conformance with the PPD spec but correct results with Macintosh print drivers.
Thanks for your feedback,
David
The text was updated successfully, but these errors were encountered: