[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Postscript File Manipulation

Posted on 1998-11-30
5
Medium Priority
?
339 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This article provides the solution to a question (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28674207.html) posed here at Experts Exchange. The asker of the question has many JPG images in many folders, and all of t…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 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