Summary: | Some EPS files do not rotate to Landscape when "-g..." option is supplied | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Till Kamppeter <till.kamppeter> |
Component: | PS Interpreter | Assignee: | Ken Sharp <ken.sharp> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 9.10 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: | M_1_no_of_ppts.eps |
Description
Till Kamppeter
2014-01-28 05:46:07 UTC
Fundamentally, as far as I can tell, there is no bug here, though there may well be some misunderstandings. Firstly its important to be aware that the dictionary argument to setpagedevice does not contain *instructions* to the interpreter, it contains a series of requests. The interpreter is supposed to attempt to match the requested media to the 'best' possibility amongst its various available media. So when you set '/Orientation 1' you are requesting that the interpreter find landscape media if possible. Further to this, EPS files don't actually have a Media size request, its not permitted for EPS files, so there is no further media request beyond the setup on the command line. We start by setting up the page device dictionary with the media you selected, 574x402. Obviously this matches, so no further work is required. Then we call setpagedevice with an Orientation. The Orientation is merged with the existing dictionary contents, and the interpreter looks to see if it can examine the request. Now, we only have one medium available (574x402), so we notice that this matches the requested media (574x402) if we *don't* rotate, and doesn't match if we do rotate. For reasons that escape me, in this case we opt to rotate the document 1 extra time, but the reasoning is pretty clear; the media matching causes the 'inability to rotate' The reason this doesn't happen if you don't specify -g (and I might add don't specify -dFIXEDMEDIA) is because for file-based output we consider the media to be infinitely variable. There is a maximum you can set but its pretty big, so you are unlikely to hit it. The default media size (595x842 for me, YMMV) fits equally well whether rotated or not rotated, so the media matching routine happily selects the rotated medium. Basically, this isn't a bug. If you want to rotate an EPS you absolutely should NOT be doing so by using /Orientation, which is a media selection parameter. You should instead use '90 rotate' or similar to set up the CTM before you render the EPS. |