Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an EPS file that, for whatever reason, looks very small on the screen when I open it with an EPS viewer (gv, in my case... but it looks the same regardless of viewer). I have to immediately zoom in to 8x magnification just to get the image to fill the screen. Of course, since it is a vector graphic, the graphic looks fine when viewed at any magnification.

My question: Is there code I can add to the EPS file to change the default zoom (in other words, to make the file display on screen as 8 times larger by default, regardless of the viewer)?

share|improve this question

1 Answer 1

You can scale the the contents of an eps format file by adding the following:

<xscale> <yscale> scale

PostScript command to it before the other commands in the file.

So to make everything 8 times bigger you would use:

8 8 scale

This scales the following graphics with respect to an origin in the lower-right, so it may also be necessary to translate everything so the area where marks appear fall within the visible portion of the "page". Not surprisingly, that can be done with a:

<xoffset> <yoffset> translate

These operations will be applied in the order order show. In other words, it will first scale the output, then translate it. Doing it in the opposite order would give different results, so it's important to remember this when figuring-out what values to use.

It's been a long time since I used ghostview, but I seem to recall there was a way to tell it to prepend a file with a preamble of commands it to each files being rendered, so you wouldn't need to actually modify the input file(s).

Conforming eps files will contain header comments that contain bounding box information of their content which can be very useful when transforming them. See section 3.1 Displaying an EPS file in the Encapsulated PostScript File Format Specification PDF file.

share|improve this answer
    
Presumably, if the EPS file has binary data, a text editor will mung (munge) that. Can ghostview prepend new commands to an EPS file which has binary data? –  horatio Dec 18 '12 at 20:49
    
@horatio: The word's munge and it depends on the text editor. I don't know the answer to your second question, since as I said, it's been a long time. –  martineau Dec 18 '12 at 20:53
    
You may also need to adjust the %%BoundingBox after scaling. –  luser droog Dec 21 '12 at 9:20
    
@luser droog: It's not possible to adjust a comment in the code that will follow nor generate one dynamically that would have any effect in the code that is executing -- but it's probably not necessary. –  martineau Dec 21 '12 at 9:50
    
I believe certain viewers (so, presumably importers too) use the bounding-box comment to set the clipping path. You'd get zoom without expanding the canvas. –  luser droog Dec 21 '12 at 10:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.