altmany / export_fig

A MATLAB toolbox for exporting publication quality figures
BSD 3-Clause "New" or "Revised" License
1.27k stars 365 forks source link

ghostscript error when I append pdf #349

Closed AndreZeug closed 2 years ago

AndreZeug commented 2 years ago

Hello, when I use export_fig to append pdf I get an Error message (see below) when using the latest Ghostscript gs9550w64. It is only when appending the pdf. When installing a previous version of GhostScript (gs9533w64) everything works fine.

Is this issue known? Did I install/configure something wrong? I use Win10 64bit, R2021b, export-fig (3.21)

Thanks for advise

Error: /undefined in .setpdfwrite Operand stack:

Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:771/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- Current allocation mode is local Last OS error: No such file or directory GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1

Ghostscript error: undefinedfilename in (C:\Users\LSM\AppData\Local\Temp\tp7223d0c8_fb43_493d_ab8c_cb5cb86b9f0f.pdf)

Ghostscript path: C:\Program Files\gs\gs9.55.0\bin\gswin64c.exe Ghostscript options: -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile="C:\Users\LSM\AppData\Local\Temp\tpc523663f_c38b_4a1e_8ceb_6a44c948ec81.pdf" -dEPSCrop -sFONTPATH="C:\Windows\Fonts" -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/DCTEncode -dGrayImageFilter=/DCTEncode -c ".setpdfwrite << /ColorImageDict << /QFactor 0.00 /Blend 1 /HSample [1 1 1 1] /VSample [1 1 1 1] >> /GrayImageDict << /QFactor 0.00 /Blend 1 /HSample [1 1 1 1] /VSample [1 1 1 1] >> >> setdistillerparams" -f "C:\Users\LSM\AppData\Local\Temp\tp7223d0c8_fb43_493d_ab8c_cb5cb86b9f0f.pdf" "C:\Users\LSM\AppData\Local\Temp\tp1e0be426_f301_4d5b_8712_49d6c440e730.eps"

Please ensure:

If the problem persists, then please report a new issue. In your report, please upload the problematic EPS file: C:\Users\LSM\AppData\Local\Temp\tp1e0be426_f301_4d5b_8712_49d6c440e730.eps (you can then delete this file).

Error using eps2pdf (line 258) Error: /undefinedfilename in (C:\Users\LSM\AppData\Local\Temp\tp7223d0c8_fb43_493d_ab8c_cb5cb86b9f0f.pdf) Operand stack:

Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push Dictionary stack: --dict:767/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- Current allocation mode is local Last OS error: No such file or directory GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1

Error in export_fig (line 962) eps2pdf(tmp_nam, pdf_nam_tmp, 1, options.append, options.colourspace==2, options.quality, options.gs_options);

Error in extract_ratio_data (line 530) export_fig(sprintf('%s.pdf',saveFileName),'-q100','-nofontswap','-append','-nocrop','-silent',fig1);

RY4GIT commented 2 years ago

Hello, I am experiencing a similar issue and so does this person https://www.mathworks.com/matlabcentral/answers/1573263-operand-stack-and-execution-stack-error-using-append_pdfs

I use Win10 64bit, R2021b, export-fig (3.21), too. My error message says as follows: Error using append_pdfs (line 108) Error: /undefinedfilename in (G:\Shared drives\...\Volume in drive G is Google Drive \n Volume Serial Number is 1983-1116 \n \n Directory of G:\Shared drives\...) Operand stack:

Execution stack:

altmany commented 2 years ago

The latest commit of append_pdf.m should improve the reporting/handling of invalid/missing input filenames, which is the suspected root cause of the errors above.

RY4GIT commented 2 years ago

Hi thank you very much for your prompt reply and I will check my filename again and use the updated function.