Solved

Postscript File Manipulation

Posted on 1998-11-30
5
323 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the help. One last (and probably difficult) question. How do I identify the origin?
0
 

Author Comment

by:cpranderia
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Screen Print 21 221
Screenshot Markup 6 88
Website cross platform development 6 29
Windows 10 Photo Editor that works on Domains 4 64
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…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now