[comp.lang.postscript] Landscape EPS files.

greg@cygnus.sce.carleton.ca (Greg Franks) (11/23/90)

Greetings:  Please forgive me if this question has been discussed to
death in the past, but I am not terribly conversant in PostScript and
I am perplexed.

I am trying to generate encapsulated post script so that I can feed
the output of a tool that we are developing here at Carleton into TeX
documents.  If I produce output from the tool with portrait
orientation, the postscript is incorporated perfectly.  However, if I
produce output with landscape orientation, TeX leaves the correct
amount of space for the figure, but places it in the wrong location.
I have checked the bounding box values from the tool for the eps file,
and they are correct (as determined by using a ruler).

In both cases I am setting up the translation matrix for the image
myself (eg [aaa 0 0 bbb xxx yyy] concat).  The entire postscript file
is bracketed with 'save' and 'restore'.  Questions: Is the concat
operation legal in EPS files? Is the fact that I am rotating the image
causing my dvi to postscript converter grief?  Or am I missing
something.

Please send email (too much news and not enough time to read it all).
I will summarize to the net if requested.  Thanks.

Sign me
  ..perplexed





-- 
Greg Franks, (613) 788-5726               | "The reason that God was able to    
Systems Engineering, Carleton University, | create the world in seven days is   
Ottawa, Ontario, Canada  K1S 5B6.         | that he didn't have to worry about 
greg@sce.carleton.ca uunet!mitel!sce!greg | the installed base" -- Enzo Torresi  

rokicki@Neon.Stanford.EDU (Tomas G. Rokicki) (11/25/90)

Two comments.

   - Landscape EPS images, when incoporated, will still be landscape.
     I presume this is what is desired.
   - Note that the bounding box of a landscape graphic is still measured
     in portrait mode.

In other words, from the perspective of the importing application, landscape
and portrait graphics are both handled precisely identically.

If this is your understanding too, please send me the problem graphic and
I will look into the problem.

-tom

glenn@heaven.woodside.ca.us (Glenn Reid) (12/02/90)

In article <1990Nov25.024943.27731@Neon.Stanford.EDU> rokicki@Neon.Stanford.EDU (Tomas G. Rokicki) writes:
>   - Landscape EPS images, when incoporated, will still be landscape.
>     I presume this is what is desired.
>   - Note that the bounding box of a landscape graphic is still measured
>     in portrait mode.
>
>In other words, from the perspective of the importing application, landscape
>and portrait graphics are both handled precisely identically.

Landscape EPS images are a very tricky thing, indeed.

It is my opinion that there is no such thing as a landscape EPS file.
Landscape is an invented concept whereby you map a PostScript image
to a physical sheet of paper by choosing to print it rotated.  An
EPS file should not contain "90 rotate 0 -612 translate" or the
equivalent, because the EPS file itself does not know how it will
be used, or whether it will be printed or cropped and scaled to
fit in some newsletter.

Now there *is* a distinction between an EPS file and a PostScript
print file; the latter has been prepared by printing by some application
or print spooler, and it is perfectly reasonable for it to contain
a landscape invocation at that point, but it also may *not* be an
EPS file any longer (it may or may not be, depending on what the file
contains).

In a display environment it can be very important for a previewing
application to understand something of the semantics of Landscape.
For example, a Preview application like the one on the NeXT computer
might want to rotate the screen image so it will read "correctly"
on the screen when previewing, rather than expecting you to turn your
head 90 degrees.  This is done on the NeXT by an extra comment that
is added to the header of the file that looks like this:

	%%Orientation: Landscape

	or 

	%%Orientation: Portrait

This further requires that all the applications rotate the same way
to get to landscape mode, else some of them may be upside-down.

But again, this is used only for files that are intended to be printed,
and which may be intercepted by the Preview application instead; the
previewer does its best to emulate the printing process in an intelligent
way, including compensating for the "90 rotate 0 -612 translate" or
whatever.

I don't think that EPS files should ever contain that kind of code; it
is enough that their aspect ratio can be divined from the bounding box
and mapped to a landscape page by the importing application if so
desired.

Glenn Reid