Hi, Kaj, I'm not sure how to fix this. The issue is that gnuplot itself doesn't close out the PDF file until it encounters a reset or a change of terminal. You can make it purge the file with ->reset() or ->restart(), or by undef'ing the object. There's even a ->close(), but that just issues a restart(). Some of the other terminals need that too -- SVG, for example -- because the file format requires a close block, and can also support multiple pages/plots.
Please let me know if those tricks *don't* work for you -- I'm putting together 1.2 now with some Microsoft Windows fixes (thanks to Sisypus and to Juergen), and I'd be glad to roll in whatever comes out of this bug. If they do, then perhaps it just needs to be placed in the documentation. Cheers, Craig On Oct 16, 2012, at 4:17 PM, Kaj Wiik wrote: > Hi! > > First: amazing work, many thanks! > > However, while producing first PDL::Graphics::Gnuplot graphs for my > student's presentation, I almost teared my hair off: everything worked > fine until I tried to write PDF files... > > It seems that version 1.0 works OK but 1.1 produces truncated PDF > files of size 4096 with pdfcairo terminal. > > Test script attached. > > Cheers, > Kaj > > ----------- > > PDL v2.4.11 > > $ perl -V > Summary of my perl5 (revision 5 version 17 subversion 3) configuration: > > Platform: > osname=linux, osvers=3.2.0-29-generic-pae, archname=i686-linux > uname='linux reissu 3.2.0-29-generic-pae #46-ubuntu smp fri jul 27 > 17:25:43 utc 2012 i686 i686 i386 gnulinux ' > config_args='-de > -Dprefix=/home/kjwiik/perl5/perlbrew/perls/perl-5.17.3 -Dusedevel' > hint=recommended, useposix=true, d_sigaction=define > useithreads=undef, usemultiplicity=undef > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > use64bitint=undef, use64bitall=undef, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', > optimize='-O2', > cppflags='-fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include' > ccversion='', gccversion='4.6.3', gccosandvers='' > intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 > ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', > lseeksize=8 > alignbytes=4, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > libpth=/usr/local/lib /lib/i386-linux-gnu /lib/../lib > /usr/lib/i386-linux-gnu /usr/lib/../lib /lib /usr/lib > libs=-lnsl -ldl -lm -lcrypt -lutil -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > libc=, so=so, useshrplib=false, libperl=libperl.a > gnulibc_version='2.15' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib > -fstack-protector' > > > Characteristics of this binary (from libperl): > Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV > PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_USE_DEVEL > USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE > USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO > USE_PERL_ATOF > Built under linux > Compiled at Aug 30 2012 07:23:31 > %ENV: > PERLBREW_BASHRC_VERSION="0.35" > PERLBREW_HOME="/home/kjwiik/.perlbrew" > PERLBREW_MANPATH="/home/kjwiik/perl5/perlbrew/perls/perl-5.17.3/man" > > PERLBREW_PATH="/home/kjwiik/perl5/perlbrew/bin:/home/kjwiik/perl5/perlbrew/perls/perl-5.17.3/bin" > PERLBREW_PERL="perl-5.17.3" > PERLBREW_ROOT="/home/kjwiik/perl5/perlbrew" > PERLBREW_VERSION="0.35" > @INC: > > /home/kjwiik/perl5/perlbrew/perls/perl-5.17.3/lib/site_perl/5.17.3/i686-linux > /home/kjwiik/perl5/perlbrew/perls/perl-5.17.3/lib/site_perl/5.17.3 > /home/kjwiik/perl5/perlbrew/perls/perl-5.17.3/lib/5.17.3/i686-linux > /home/kjwiik/perl5/perlbrew/perls/perl-5.17.3/lib/5.17.3 > . > > uname -a > Linux reissu 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 > UTC 2012 i686 i686 i386 GNU/Linux > <gptest.pl> _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
