?
Solved

Postscript File Manipulation

Posted on 1998-11-30
5
Medium Priority
?
330 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
tfabian earned 400 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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…
PaperPort 14.5 Patch 1 update is often not detected or downloaded automatically. This article provides direct download links to solve the problem for retail (non-bundled) versions of the Standard and Professional editions, as well as the Professiona…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses
Course of the Month11 days, 4 hours left to enroll

770 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