octave-maintainers
[Top][All Lists]
Advanced

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

Re: fltk printing


From: bpabbott
Subject: Re: fltk printing
Date: Sat, 07 Aug 2010 15:56:10 -0700 (PDT)

On 07 Aug, 2010,at 06:23 PM, Michael D Godfrey <address@hidden> wrote:

On 08/07/2010 02:36 PM, Dmitri A. Sergatskov wrote:
In any case, I just verified that the opts passed to __fltk_print__.m  is
> the same for
> print test.pdf and print('test.pdf').   But, testpdf still always fails and
> ('test.pdf') always
> works.
>
More fun:

octave:1> backend ("fltk")
octave:2> plot(rand(10))
octave:3> print test1.pdf
GPL Ghostscript 8.71: Unrecoverable error, exit code 1
warning: print.m: ghostscript failed to convert output to file 'test1.pdf'.
No such file or directory
warning: print.m: failed to delete temporay file, '/tmp/oct-Jo1lWX.eps'.
octave:4> plot(rand(20))
octave:5> print test1.pdf
GPL Ghostscript 8.71: Unrecoverable error, exit code 1
warning: print.m: ghostscript failed to convert output to file 'test1.pdf'.
No such file or directory
warning: print.m: failed to delete temporay file, '/tmp/oct-tqNhOA.eps'.
octave:6> plot(rand(50))
octave:7> print test1.pdf
octave:8> plot(rand(10))
octave:9> print test1.pdf
octave:10>
(From this moment on it works)


> Michael
>
>
Dmitri.
--
Here are results of retry of the drawnow call:
octave:1> plot(1:100)
octave:2> print ('test.pdf')
retry drawnow no: 0
retry drawnow no: 1
retry drawnow no: 2
oct-XGcnks.eps
octave:3> print ('test.pdf')
retry drawnow no: 0
retry drawnow no: 1
oct-Ht99Ph.eps
octave:4> plot(1:200)
octave:5> print ('test.pdf')
retry drawnow no: 0
retry drawnow no: 1
oct-UA7tHV.eps
octave:6> print ('test.pdf')
retry drawnow no: 0
retry drawnow no: 1
oct-XU0wRy.eps
octave:7> close all
octave:8> plot(1:200)
octave:9> print ('test.pdf')
retry drawnow no: 0
retry drawnow no: 1
oct-cGyaGM.eps
octave:10> print ('test.pdf')
retry drawnow no: 0
retry drawnow no: 1
oct-CqwYmxeps
octave:11> print ('test2.pdf')
retry drawnow no: 0
retry drawnow no: 1
oct-BO30VH.eps
octave:12>
====================================
Worst case seems to be 3 calls, but in this example even after
close all it only took 2 retrys.

Pretty dumb, but it works!

For Ben:

In case you want it, my wait_for_file function including diagnostic print is:
function wait_for_file (source)
  status = 0;
  iter = 0;
  if (numel (source) > 0)
    while (! exist (source, "file") && iter < 10)
      printf("retry drawnow no: %d\n", iter);
      drawnow ("eps",source);
      pause(0.1);
      iter=iter+1;
    endwhile
    if (iter == 10)
      status = -1;
    endif
  else
    status = -1;
    return
  endif
  if (status < 0)
    error ("print:filedoesntexist", "print.m: file '%s' does not exist.", source);
  endif
endfunction
================================
It's only redeeming feature is that it works.

Michael 
 
I am doubtful the "drawnow()" has any effect.

If it does, then it indicates that gl2ps isn't doing its job, and the problem isn't timing / synchronization at all.

Ben





reply via email to

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