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

append_pdfs error #378

Open katiebogue opened 1 year ago

katiebogue commented 1 year ago

Hello, I continue to get the following error any time I try to use append_pdfs: Error using append_pdfs (line 131) Unterminated quote in @-file: temp.pdf"

where temp.pdf is whatever the last file was in the list of files that I was trying to append. This has been happening on and off for months now but usually resolves when I unlink and then relink Ghostscript with Homebrew. However, this did not work this time. I have the most updated Ghostscript and the most updated export_fig. Please advise.

Here are 2 sample inputs and the error they throw:

append_pdfs('final.pdf', 'temp1.pdf', 'temp2.pdf', 'temp3.pdf') Error using append_pdfs (line 131) Unterminated quote in @-file: temp3.pdf" saveas(gcf, append('temp.pdf')) append_pdfs(pdf_name, append('temp.pdf')) Error using append_pdfs (line 131) Unterminated quote in @-file: temp.pdf"

altmany commented 1 year ago

Please try it with the latest commit (694e85b) and let me know if it solved the problem or not.

If the problem persists, please send me the extra text output that should not be displayed in case of a ghostscript error, that will help debug the problem.

katiebogue commented 1 year ago

Unfortunately, that did not fix the issue. The extra text + error now looks like this: -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile="/private/var/folders/03/7r1dhlhd0ds9y8t_9cpzgqrr0000gn/T/tp1b76df99_d9e7_4796_9244_9c6417bffd76.pdf" -f "RESULTS_2023-06-11 13-38_PPlnth-4_with_int.pdf" "temp.pdf" Error using append_pdfs (line 134) Unterminated quote in @-file: temp.pdf"

altmany commented 1 year ago

Please check if the latest commit (47ab1f9) fixes this issue. In this latest version, there should only be quotation marks now around filenames that contain a space, and hopefully this resolves the problem.