octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Print to PDF under Windows


From: Michael Goffioul
Subject: Re: Print to PDF under Windows
Date: Fri, 20 Nov 2009 11:07:17 +0000

On Thu, Nov 19, 2009 at 9:45 PM, Ben Abbott <address@hidden> wrote:
> On Thursday, November 19, 2009, at 03:39PM, "Michael Goffioul" 
> <address@hidden> wrote:
>>Hi,
>>
>>In print.m, I see the following pieces of code:
>>
>>... (line 194)
>>  elseif (ispc ())
>>    if (~isempty (getenv ("GSC")))
>>      persistent ghostscript_binary = getenv ("GSC");
>>    else
>>      persistent ghostscript_binary = "gswin32c";
>>    endif
>>...
>>... (line 265)
>>    elseif (ispc ())
>>      [status, output] = system (sprintf ("if exist \"%s\" ( exit /B 1
>>) else ( exit /B 0 )", ghostscript_binary));
>>      have_ghostscript = (status ~= 0);
>>    endif
>>...
>>
>>Now, let's say GSC is not defined. How is this supposed to work?
>>The "system" call will check for the existence of a file named
>>"gswin32c" in the current directory. This will never work... or am
>>I missing something?
>>
>>Wouldn't it be better to default to
>>
>>      persistent ghostscript_binary = file_in_path(EXEC_PATH, "gswin32c.exe");
>>
>>Michael.
>
> I'd expect both to work. Unless the the windows binary bundles ghostscript 
> with octave. Is that the case?

I don't get it. The line

[status, output] = system (sprintf ("if exist \"%s\" ( exit /B 1) else
( exit /B 0 )", ghostscript_binary));

will check for the existence of "gswin32c" in the current directory.
First, it should be "gswin32.exe". Second you will never have "gswin32c.exe"
in the current directory when using "print" in normal situation.

Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]