PDA

View Full Version : Postscript to PDF help




Ianarchy
May 20, 2012, 12:11 PM
Hello, I'm new to the forum and new to Mac as well. I've done a lot of reading, research and experimenting but so far can not find what I want, maybe someone here can help.

What I'd like is to print to PDF but the PDF is first rendered as a postscript file then saved as a PDF and the postscript deleted.

I have found no program that does this and even experimented with CUPS-PDF to no avail. I've been thinking there might be an applescript that could perform this task, but my search has not found any and I'm completely green with Mac scripting.

Any ideas?



chown33
May 20, 2012, 01:53 PM
Please describe exactly what you want to accomplish. You've partially described some attempted solutions, but you haven't described what you're trying to accomplish.
http://www.perlmonks.org/index.pl?node_id=542341
.. You want to do X, and you think Y is the best way of doing it.
.. Instead of asking about X, you ask about Y.


Why does it first have to be rendered to Postscript, if the PS will then be rendered to PDF and the PS deleted? One could render it to hieroglyphics or Morse code as an intermediate step, then delete that, but the result is the same: output in PDF. So please explain exactly why the intermediate Postscript is needed, if it's only going to be deleted.

Exactly what is doing the printing to PDF? Applications that use the system print dialogs? Do you mean you want a printer "device" that produces PDF? Isn't that what CUPS-PDF is? If that's not what you want, please explain how what you want differs from CUPS-PDF, and exactly how CUPS-PDF failed to produce the desired result. Be specific.

You've described what you want as output: PDF. That's clear enough. Unfortunately, I don't see any description of the input or the processing tool. So two of the three elements of a standard Input:Process:Output chain are missing. All we know is you want some tool to process some input and produce PDF.

It's possible some command-line tools might do what you want, like enscript (https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/enscript.1.html), but without knowing the input or the processing tool, that's just a wild guess.

xStep
May 20, 2012, 03:07 PM
As chown33 mentioned, more information is needed. Are you writing a OS X app using Objective-C, or writing a script that processes some data through several other steps and apps? Details matter.

In the meantime, check out the very first paragraph here (http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_ps_convert/dq_ps_convert.html).

If you are writing a script and Preview isn't appropriate, perhaps installing Ghostscript is a solution. It can convert PS to PDF.

chown33. Around 2005 I have had one scenario where PS was needed before producing a PDF. It was a strange work related one where I converted an existing text report to include graphics. I had a pre-writtten header block of PS, dynamically included pre-written blocks of EPS code for each required graphic per report, and calculated each graphic rendering position and reuse of graphic where needed. Once that PS creation was completed, I rendered to PDF for email and use half way around the world to reduce mis-printing on computer chips. Given a time constraint, this path was much easier than learning the more complicated setup of PDF that I ran into. The report is still in use today. :D

Ianarchy
May 20, 2012, 08:36 PM
Thanks for the replies, guys, I will be happy to explain more.

I have several company documents that are in Pages and these have to be altered and saved as PDFs very frequently. The standard Mac print to PDF puts out a file size that is insanely big for my purposes and/or the quality is too poor to show a client. The only way I have found to make a PDF with both a decent resolution and a small file size is to first save it as a .ps then through Adobe Distiller convert it to PDF. This is the only method I've found to consistently give me good results. I've tried tweaking the Pages file in many different ways, and I've tried many different methods of saving/exporting to PDF, but at the end of the day, the version that looks the best across all platforms is .ps to .pdf through Distiller.

So, in a perfect world, what I'd like is for this to be a one step process. The same way in Print I can choose "Save As PDF", "Save As Postscript", "Save As Adobe PDF", etc. I would like to be able to "Save As PS/PDF" or some such thing where the file first goes out as .ps then converts through Distiller and deletes the .ps giving me the .pdf file rendered in the way that I want.

Clown33 & xStep - thank you for the links you provided, I will have a careful read through them and see what I can pick out. I appreciate your help.

chown33
May 20, 2012, 11:50 PM
I suggest a folder action.

Create a folder with a folder action. It can be any folder. Use Automator to make the folder action. In the action, have it run Preview.app or Distiller to open the Postscript, convert to PDF, then save in another output folder.

Now you can save a whole bunch of Pages documents to Postscript, then move the whole lot of .ps files to your actionized folder. That moving of files triggers the folder action. If that doesn't make sense, then read about folder actions (google search terms: mac folder actions).

I recommend Automator over raw AppleScripts because Automator has a bunch of conversion actions builtin.

To find more options, google search terms: postscript to pdf mac

Ianarchy
May 21, 2012, 12:34 AM
Thanks Clown33, that's good advice.

Yes, I looked at Automator when I first wanted to do this project and coincidentally started coming back to it today.

Could you tell me where I might find the action for saving as a postscript? I see lots of Automator options for saving as a PDF, so surely there must be a way to save as a postscript. If I can find, or create, that action then couldn't I run a print->PDF option the same as "Save As Adobe PDF" in the PDF menu that would save as a postscript, run the postscript through distiller and delete the .ps file?