Ben Abbott wrote:
On Monday, August 17, 2009, at 11:27AM, "Benjamin Lindner"
<address@hidden> wrote:
Hello list,
I wondered if it is possible to force print.m to use ghostscript for
printing to pdf even if gnuplot provides a pdfcairo terminal?
I ask because the last available gnuplot for win32 does not include the
patch which fixes the spurious-pages-in-pdf-output bug.
So a command as
plot(0:0.1:10, sin(0:0.1:10), "@-"); print -dpdf test.pdf
produces a three-page pdf.
I don't know when there will be a new gnuplot release or snapshot
release but the do not happen very frequently.
So for the mingw32 binaries I'd like to have print.m to use ps->pdf via
ghostscript for the moment.
benjamin
I assume you are referring to Octave's latest sources, and that you
are not running gnuplot's development sources (meaning your version of
gnuplot is 4.2.x, or earlier)?
Actually I'm referring to the 3.2.x branch of octave and the latest
version of gnuplot available is the 2008-11-21 4.3.0 cvs snapshot.
If so then, what you're asking for should be the default. If it is
not, then the check for ghostscript may be failing.
Does the code below indicate you have ghostscript installed?
if (~isempty (getenv ("GSC")))
persistent ghostscript_binary = getenv ("GSC");
else
persistent ghostscript_binary = "gswin32c";
endif
[status, output] = system (sprintf ("if exist \"%s\" ( exit /B 1 )
else ( exit /B 0 )", ghostscript_binary));
have_ghostscript = (status == 0)
Ben
thanks for the hint.
I have the environment variable GSC defined as
> ghostscript_binary = getenv("GSC")
ghostscript_binary = C:\Programs\gs\gs8.62\bin\gswin32c.exe
and naturally this executable exists.
However, have_ghostscript evaluates to false.
This is strange.
Seems the exit code is not propagated into the variable status, as
> [s,o]=system("exit 1")
s = 127
o =
but
> system("exit 1")
ans = 1
I need to investigate this further.