2015b ghostscript not found - ps2pdf multi-page ps to pdf
이전 댓글 표시
the release notes for 2015b state that "MATLAB no longer ships with theGhostscript® library. Remove all instances of code that use ghostscript.m"
This breaks the our code which prints multi-page ps and then uses ps2pdf to convert to a multipage pdf. So far this is the only way we have found to get the SVG or vector graphics format into a multi-page pdf.
Unfortunately it is now broken, so what do you suggest we replace this with? Is there a way to do this with saveas now? Or can we somehow run the 2014b mex inside 2015b?
댓글 수: 1
Jesper Sallander
2015년 11월 4일
We have the exact same problem! Best solution would be if Mathworks could enable the -append functionality for pdf's too in the next release. The only reason for us to go via .ps files is this multi page option which is only available for ps. It is very handy to produce a single pdf report with all the graphs in the same file.
채택된 답변
추가 답변 (7개)
LR
2016년 6월 23일
1 개 추천
Hi all,
I had the same problem for a while, but then I found the export_fig toolbox, which includes a function called append_pdfs which works well. Here's a link to that: http://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig
You may have to download gs9.19 from http://ghostscript.com/download/ though, but that's not a big deal.
ps2pdf isn't working for me,
(I get this error message: Problem converting PostScript. System returned error: 1.'""' is not recognized as an internal or external command, operable program or batch file.)
so I'm going to go with this.
Hope this helps,
L
댓글 수: 4
Yang Liu
2019년 11월 23일
Although I have installed the ghostscript, but there is still one problem as shown in the following picture:

Walter Roberson
2019년 11월 23일
We need to see more of the error message.
What shows up for
which ghostscript
munire ozlem cevik
2020년 1월 26일
Hello,
I downloaded Ghostscript 9.50.
I get the same error message above when I call append_pdfs:
Undefined function or variable 'ghostscript'.
Error in append_pdfs (line 32)
[status, errMsg] = ghostscript(['@"' cmdfile '"']);
which ghostscript returns 'ghostscript not found'.
What should I do for MATLAB to access ghostscript?
Walter Roberson
2020년 1월 26일
You need to create something like
function [status, errMsg] = ghostscript(cmd)
[status, errMsg] = system(['ghostscript ', cmd]);
end
Attilio
2016년 1월 9일
0 개 추천
I share the opinion of Peter Vincent and Dr. Bagels. The existing commands saveas and print do allow only saving a single figure to a pdf file, yet easily, but saving a previously created set of figures to become a unique pdf has now become unexpectedly complicated. Best regards Attilio Brighenti
Lukas Hoffmann
2016년 4월 4일
0 개 추천
I agree, Matlab should have a standalone option to convert PS to multi-page PDF
Herb 2.0
2016년 4월 8일
0 개 추천
I agree too, this functionality should be available in Matlab
Rajesh
2016년 10월 19일
0 개 추천
I share the opinion of Peter Vincent. Matlab should have the support for ghostscript. If you would remove it, then Matlab should at least provide native functions to do the same (ps to pdf, or appending pdfs etc.)
Jan
2016년 10월 19일
0 개 추천
I do not see the problem: While earlier versions of Matlab contained a specific GhostScript version, the new versions don't. But GhostScript is available for free. I always used the newest version instead of the one shipped with Matlab, e.g. to convert EPS files to PDF.
Calling GhostScript is much easier and works fluently. In opposite to this, there is a bunch of troubles you can get with installing a compatible C-compiler, as the large number of questions demonstrates.
Teizeen Mohamedali
2016년 11월 10일
0 개 추천
Where do you install Ghostscript - in C:/Program Files, or do you have to move some of the Ghostscript files (which ones? just the .exe?) into the MATLAB root directory in the 'sys' folder?
댓글 수: 2
John Isler
2017년 9월 9일
I installed the newest version of ghost script, but still had trouble with running ps2pdf. I placed the ghostscript files in several places for Matlab 2016b with not luck. I even matched some gsData definitions to match what earlier versions of Matlab were defining with the script.
John Isler
2017년 9월 9일
However, I found export_fig (https://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig) with the '-append' feature to do the trick. Hope this helps!
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!