Solved

Postscript File Manipulation

Posted on 1998-11-30
5
326 Views
Last Modified: 2013-12-02
I have a set of postscript graphics files which are a4 size portraits. I would like to rotate them clockwise through 90 degrees and scale them so that I can fit two on one page in a report.

I have tried using Ghostscript's 'rotate' header file which does the rotation fine, but I don't know how to scale them and I am at a loss to identify the origin of the image so that I know how to offset it once rotated.

Can anyone help? Is there any software on the Internet which isn't called Framemaker and doesn't cost lots of money?

TIA
0
Comment
Question by:cpranderia
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
tfabian earned 100 total points
ID: 1113284
try the scale operator in postscript..

it allows you to change the sizze of the units used by postscript. it takes two arguements fom the stack, an x and y scaling factor, and changes the size of the coordinate systems's units by those factors..

eg.  

  3 3 scale

will triple the size of the coordinate systems's units..

objects will be drawn three times as large as they would have been before this command was executed.

so for example, if you want to make your image 1/2 size,
put


5 .5 scale

at the beginning of the postscript file..


you could also accomplish the rotation in a similar fashion (if you want to do everything at once instead of using Ghostscript..


 90 rotate


would rotate 90 degrees..

180 rotate

would rotate 180 degrees...

and so on..

for more details, see pages 49-50 of the

 Postscript Language Tutorial and Cookbook

  by Adobe Systems Inc.




0
 
LVL 5

Expert Comment

by:tfabian
ID: 1113285
on finding the origin point of the image,

 100 200 translate


moves the origin to the point (100,200)

so by cutting and pasting your two postscript files together, with some additions to format the page, you can probably build what you want..


eg.


    100 100 translate
    90 rotate
    .5 .5 scale

    first ps image here minus the showpage command


    200 100 translate
    90 rotate
    .5 .5 scale

    second ps image here including the showpage command



you may have to play with the order of the commands too..


good luck



0
 

Author Comment

by:cpranderia
ID: 1113286
Thanks for the answer - I will try the rotate and scale commands. However, what about offseting the image on the page? For example, if I rotate one image through 90degrees clockwise and scale it down by .5 .5, how would I offset it on the page so that it appeared in the bottom part of the page?
0
 

Author Comment

by:cpranderia
ID: 1113287
Thanks for the help. One last (and probably difficult) question. How do I identify the origin?
0
 

Author Comment

by:cpranderia
ID: 1113288
No need to answer...I just rotated by a small angle and looked at the images to see. The only other thing to say is that I needed to add a grestore where I took out a showpage otherwise the scale and rotate was cumulative. But it works!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Learn the basics of inputting and editing your text components in Prezi. We will cover how to set styles, position, and group your text components. In your Prezi editor, click anywhere on the canvas to add text: A flashing cursor informs you that yo…
It’s easy to embed any of your public Prezi presentations on your website or social network to share with others. Learn how simple it is in this tutorial.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question