Apache OpenOffice (AOO) Bugzilla – Issue 15879
Implement Seascape orientation
Last modified: 2013-02-07 22:35:48 UTC
Sorry for the long post--I've done a lot of research for this post, so I want to prevent any duplication of effort. I tried to arrange the most important information at the top. Summary: In Writer, when a page is formatted in landscape mode (i.e. select "Landscape" at "Format"|"Page," "Page" tab, "Paper Format" section, "Orientation" radio group) and margins (on the same "Page" tab, but in the "Margins" section) are set to 0 (any units) for a printer that cannot print without margins, OOo pops up a dialog saying "The margin settings are out of print range. Do you still want to apply these settings? If the user answers "No," he/she is returned to the "Page" tab with the margin settings "corrected" for the currently defined printer. However, the left and right margins seem to be reversed (on screen only--not in the printout). Details: When OOo determines the smallest allowable margins (as described above) for a landscape Letter-sized page using the HP DeskJet 5550, it sets margins at 9pts left, 18pts top/bottom, and 36pts right. The PPD for the HP DeskJet 5550 (attached) specifies *ImageableArea Letter/Letter: "18 36 594 783" These settings can be verified at http://hpinkjet.sourceforge.net/printmodedescr.php#PrintableArea under the Device Class DJGenericVIP (note that the table specifies width and height of printable area, not top/right coordinates). This means that the page should have margins at 36pts left, 18pts top/bottom, and 9 pts right (see "Assumptions/Reasoning/Terminology" below). The PostScript output created by printing the document from OOo specifies: %%BoundingBox: 0 0 612 792 and %%PageBoundingBox: 18 36 594 783 In other words, the generated PostScript is 100% correct according to the PPD. This also means that the 36pt margin is on the left of the document. However, the on-screen display of the document shows the 36pt margin (calculated automatically as descibed above) on the right side of the document. To duplicate: Using the attached PPD file (may also require foomatic-rip at http://www.linuxprinting.org/download.cgi?filename=foomatic-rip&show=0 ), follow the instructions given in the Summary to create a Letter-sized page in landscape orientation with the "smallest allowable margins" calculated by OOo. Apply a border around the page ("Format"|"Page," "Borders" tab, click on the box icon in the "Line arrangement" section and select "OK"). Print the document to a file and verify the BoundingBox agrees with the values in the PPD. View the PostScript file onscreen (i.e. with gv and ensure that the page size is set to "Letter" (not "BBox" or "BoundingBox") to allow you to see the unprintable border around the document. Notice the wide margin is on the left--opposite that shown by OOo. Workaround: Ignore the "white paper" beyond the margins displayed onscreen. Because the Pos tScript output is correct, as long as the user aligns content relative to the "ImageableArea" (i.e. area inside the margins), the content will appear in the correct locations when finally printed. Recommendations: I thought about creating a patch myself, but there are many different approaches that can be taken for solving this problem. Therefore, I am hoping this bug report will start a discussion to determine the most appropriate course of action. The easiest fix would be to fix the logic used by the display to correctly determine the margins based on the printer info. (Note, however, that the logic used by psprint *is* correct--I don't know about Xprint (if it even matters anymore) or the Windows GDI API.) This would be the easiest solution as it seems the logic simply reverses the values for left and right. (Yes, I also tested this with differing top/bottom margins and have verified that they are handled properly--only the left/right margins are swapped and only on-screen.) Of course, integrating the logic into a single component which is used by psprint and the display would be a better solution (especially if handling of page orientation is enhanced as described below), but may not be feasible (I don't know the code well enough to say :). Another possibility is to enhance the handling of page orientation by adding support for both "landscape" and "seascape" orientations. This would make using OpenOffice with certain printers much easier (see "Assumptions/Reasoning/Terminology" below). The best way to implement this change is to make it "automatic." The PPD specification defines a keyword "LandscapeOrientation" to specify which transformation should be used for creating output. The current PPD parser does not seem to recognize this keyword. If integrated into the parser, it's value should default to "Plus90" (i.e. landscape) and could be used by "GetLandscapeAngle" to determine which transformation is being used (and, therefore, on which sides of the page each margin belongs). This PPD specification makes the LandscapeOrientation keyword optional, but this would cover most situations where a difference is needed. Another (easier to implement) approach is to make a user-configurable setting for printing to seascape instead of landscape. The setting cannot be in the "Printer Properties" dialog box (since that is created automatically from the PPD)--and would probably cause more problems that it solves if it were that easy to find. :) Therefore, I would recommend "hiding" the option in the "Options - OpenOffice.org - Print" dialog box ("Tools"|"Options", "OpenOffice.org" branch, "Print" node). As a matter of fact, even if we implement "automatic" handling as described above, this option would be useful to those whose PPD's do not specify handling and who are afraid of editing PPD's. Assumptions/Reasoning/Terminology I am assuming that the generated PostScript is correct and the on-screen display is incorrect. Reasoning: The PPD Specification ( http://partners.adobe.com/asn/developer/pdfs/tn/5003.PPD_Spec_v4.3.pdf ), page 104, section *LandscapeOrientation specifies a keyword which may be used to specify how a print manager should rotate and tranlate the origin of the default user space on the page to print a document in landscape orientation. The sole purpose for this keyword is to ensure the output is created according to page feeding instructions on the printer or in the printer's manual (mostly important for letter-head, 3-hole-punched pager, envelopes, etc.). Possible values include "Plus90," "Minus90," and "Any." Plus90 (often called landscape) instructs the print manager to perform the functional equivalent of 90 rotate 0 pagewidth neg translate (basically moves the origin from the lower-left corner to the lower-right corner of the page and "swaps" the x and y axes). and Minus90 (often called seascape) instructs the print manager to perform the functional equivalent of 90 neg rotate pageheight neg 0 translate (moves the origin from the lower-left corner to the upper-right corner of the page and "swaps" the x and y axes). The diagrams below show the relationship between Portrait, Landscape, and Sescape. Note that the page itself (and, therefore, the printable area of the page) is not moving--only the coordinates we use to locate points on the page change. Coordinate Systems - Letter size paper Portrait (0,792) (612,792) -------------- | :'''''''': | | : : | | : : | | : : | | : : | | : : | | : : | +y | :........: | ^ | | | -------------- | (0,0) (612,0) '----> +x Landscape - Plus90 - 90deg ccw (792,612) (792,0) -------------- | :'''''''': | | : : | | : : | | : : | | : : | | : : | | : : | | :........: | +x | | ^ -------------- | (0,612) (0,0) | +y <----' Seascape - Minus90 - 90deg cw .----> +y |(0,0) (0,612) | -------------- v | :'''''''': | +x | : : | | : : | | : : | | : : | | : : | | : : | | :........: | | | -------------- (792,0) (792,612) The "left" side of the page--regardless of orientation--has an x coordinate of 0 and the "bottom" has a y coordinate of 0 (with "right" being the side opposite left and "top" being the side opposite bottom). Since the DeskJet 5550 has an ImageableArea of "18 36 594 783," a portrait page has margins of 18pts left and right, 9pts top, and 36pts bottom. A landscape page has margins of 18pts top and bottom, 9pts right, and 36pts left. A seascape page has margins of 18pts top and bottom, 9pts left, and 36pts right. I am using OOo version: 1.0.3.1 [SRC641_[8584]_LINUX_INTEL_cdelab25_at_4/15/03_3:56:54]
Created attachment 7022 [details] PPD for HP DeskJet 5550--has differing left/right margins for landscape page
On further consideration, I think that the user-configurable option for seascape orientation should be placed next to the portrait and landscape options (at "Format"|"Page," "Page" tab, "Paper Format" section, "Orientation" radio group). This way, the option is not global (affecting all printers and all documents), but can be set differently for different documents (or even different pages within the same document). Although it may cause some confusion, it should be easy enough to document in the help (i.e. something to the effect of: effectively swaps your left and right margins and your top and bottom margins; if your printer has identical left and right and identical top and bottom margins the setting has no functional difference with blank paper; allows you to print on the opposite end of an envelope or letterhead paper...)
cp->pl: looks like left and right margin are reversed in the printer settings. Please have a look/check. Pass on to Lutz eventually for the seascape RFE. cp->michael: please do not mix requests for enhancements into bugs: file a separate issue for each problem. It eases the handling a lot.
Sorry the RFE in the bug report. Do you want me to re-file the RFE as an RFE?
started
as you said i mixed left/right and top/bottom margins in Landscape case (fixed in CWS vcl15). About the seascape feature: currently psprint does not emit anything for Landscape but a rotated/moved matrix; for the PostScript interpreter we still are in Portrait mode. This has the advantage that it works on any printer, regardless whether it is actually ghostscript doing the rendering or someone used the "Generic Printer" PPD with whatever PostScript printer they actually have. A seascape feature still would have its value since if you want to switch to land-/seascape inside a multi page document. I'll flag this one as an RFE and send it to LHO for further discussion and have created issue 16610 for the bug fix.
Lutz -> Bettina: Please handle this one. As you know, I'm not a friend of additional settings. Please work with Philipp to find out if there's a more elegant way to deal with the problem. What would be the impact, if we don't change anything? How many users would be affected? Is there data about this? Thanks!
Just a small remark: When using <pageDown> in the margins-field OOo sets the value to the smallest possible value - no need to specify "0", get the warning and klick OK
Summary: Implement Seascape orientation. This issue is considered for OO.o later.
To grep the issues easier via "requirements" I put the issues currently lying on my owner to the owner "requirements".