postscript output is rotated 90 degrees?
First, I'd like to apologize to Bulia Byak for getting huffy about his earlier post on this topic -- it was dumb of me to interpret it in such a negative way.
This issue has been the subject of three bug reports on the Sourceforge bug tracker: 1014460 1071596 1082762 Wolfiq's patch, which caused rotation of PS/EPS output when the width was greater than the height, has caused problems for dlehn, Jan, Erik Jonsson, and me. I think the fact that people keep reporting it as a bug -- on Sourceforge, and here on the mailing list -- indicates that there's a serious problem because of the patch. Although the patch produces the behavior that was expected by someone like wolfiq, who intentionally did File>New>...landscape, the behavior seemed incorrect and mysterious to the rest of us, who had been using Inkscape to produce small figures for inclusion in LaTeX documents. I've written a patch for the patch, which is intended to provide the behavior that Wolfiq wants, while fixing the problem for the rest of us. The patch is given at the end of this e-mail. I would like to emphasize that the original patch produces a real showstopper bug for those of us who needed to produce output that was wider that it was tall -- right now there is no way whatsoever to produce the correct (wide) PS/EPS output with inkscape.
In the long term, the right solution would probably be to add a portrait/landscape bit to the SVG file. - The bit should be set to landscape if the user creates the file using File>New>...landscape. - There should be a way to control the bit using the GUI. - The rotation should also apply to bitmap printing, not just PS/EPS. - The Print and Save As dialogs should probably also allow the rotation to be turned on or off. However, my C++ and GTK skills probably are not up to the task of making these changes. In the meantime, I hope my stopgap patch can be applied by the committers.
==================================
patch to extension/internal/ps.cpp:
354c354,370 < pageLandscape = ( d.y1 - d.y0 < d.x1 - d.x0 ); ---
// 2004 Dec 10, BFC: // The point of the following code is (1) to do the thing that's expected by users // who have done File>New>A4_landscape or ...letter_landscape (i.e., rotate // the output), while (2) not messing up users who simply want their output wider // than it is tall (e.g., small figures for inclusion in LaTeX). // The original patch by WQ only had the w>h condition. { int w,h; // width and height of bounding box, in points w = (int) (d.x1-d.x0); h = (int) (d.y1-d.y0); pageLandscape = ( (w>0 && h>0) // empty documents fail this sanity check && (w>h) // implies, but does not prove, the user wanted landscape && (w>600) // approximate maximum printable width of an A4 ) ? true : false; }
In the long term, the right solution would probably be to add a portrait/landscape bit to the SVG file.
- The bit should be set to landscape if the user creates the file using File>New>...landscape.
- There should be a way to control the bit using the GUI.
- The rotation should also apply to bitmap printing, not just PS/EPS.
- The Print and Save As dialogs should probably also allow the rotation to be turned on or off.
Agreed. Someone will eventually need to write a much larger patch to implement all this.
pageLandscape = ( (w>0 && h>0) // empty documents fail this sanity check && (w>h) // implies, but does not prove, the user wanted landscape && (w>600) // approximate maximum printable width of an A4 )
I think that makes sense. Now automatic rotation will only be triggered for drawings that are wider than the page. I applied this patch. Thank you.
(As you see, making patches is not difficult at all :)
participants (2)
-
Ben Crowell
-
bulia byak