4.57143

4.6 | 7 ratings Rate this file 135 downloads (last 30 days) File Size: 5.13 KB File ID: #19516

ps2pdf

by Richard Quist

 

09 Apr 2008 (Updated 18 Aug 2008)

Code covered by BSD License  

Convert PostScript file to PDF using Ghostscript; each input page onto a separate output page

Download Now | Watch this File

File Information
Description

Converts a postscript file into PDF. The resulting PDF file will contain one page for each page defined in the postscript files, so a multi-page postscript file, like those generated by using the '-append' option of MATLAB's print command, can be used to generate a multi-page PDF file.

Works with the version of Ghostscript shipped with MATLAB, if found, or with a user-specified version.

Also works with older MATLAB versions, such as R2006b.

MATLAB release MATLAB 7.6 (R2008a)
Other requirements Ghostscript; works with older versions of MATLAB, too.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (8)
09 Apr 2008 Yuri Kotliarov

It's amazing! I just started looking for this feature and found this function dated TODAY. Tested on 2007b. Works like a charm. Thanks a lot!

01 Jul 2008 Pablo Pablo

Excelent script.
Tested on Matlab2008a
Thanks a lot.

04 Aug 2008 Naveen K

Perfect. Exactly what i needed. Many thanks Richard.

22 Aug 2008 Pat Murray

Excellent, exactly what I needed, saves me a time-consuming step for my project.

Thanks!

10 Sep 2008 Mat K

Great Script, options to set Author, Title, Subject etc. would make it superior...

07 Jan 2009 Tom Mat  
07 Jan 2009 Tom Mat

The Title (push Ctrl+Shift+D in Acrobat) of the pdf files, is the name and path of the ps File. It would be good to have an option to avoid this...

14 Oct 2009 Andrew Bytheway

Great idea! I did experience problems when using this script in a deployed application (R2009a). The built-in version of Ghostscript doesn't work in deployed applications. It returns the following error:
??? Undefined function or method 'gscript' for input arguments of type 'char'.
Clearly it is failing to recognize the call to gscript altough the function handle was created correctly, and the needed mexw32 file is distributed with the MCR v7.10

Any ideas ???

Please login to add a comment or rating.
Updates
14 Apr 2008

added screenshot

21 Apr 2008

added option to delete input postscript file after creating pdf file. Default is to NOT delete the input ps file

18 Aug 2008

fixed failure when MATLAB's path to ghostscript contained an embedded space.

Tag Activity for this File
Tag Applied By Date/Time
graphics import Richard Quist 22 Oct 2008 09:56:59
graphics export Richard Quist 22 Oct 2008 09:56:59
pdf Richard Quist 22 Oct 2008 09:56:59
postscript Richard Quist 22 Oct 2008 09:56:59
conversion Richard Quist 22 Oct 2008 09:56:59
multipage pdf Richard Quist 22 Oct 2008 09:56:59
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com