bugGNU Octave - Bugs: bug #37053, Saveas & Print error when...

 
 

bug #37053: Saveas & Print error when saving as .emf

Submitter:  None
Submitted:  Wed 08 Aug 2012 09:41:16 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Wont Fix Assigned to:  lostbard
Originator Name:  JK Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 11 Aug 2016 11:19:22 PM UTC, comment #35: 

i agree - no longer an octave issue - it would be nice to submit a bug report to xfig for the issue, but is outside the scope of this ticket.


John Donoghue <lostbard>
Group Member
Thu 11 Aug 2016 11:01:19 PM UTC, comment #34: 


> As another test, what about an emf file created on Linux and copied to a Windows machine? If that can't be read by MS Paint 10 then it is a problem with fig2dev and we should just stop since that is an upstream problem.


Done.
Test results was as expected:
 A resulted emf file was rejected by MS-paint but was accepted by other applications.

> So now it as least consistent with the 3.6.X versions of octave?


AFAIK, yes.


As Rik state that this is no longer an issue that is limited to MS-windows and an issue of supporting application "fig2dev".

I agree with Rik's statement but final decision should be done by John to whom this bug is assigned to.

I tried to access support item of Xfig project on SourceForge site but I could not access there.

Tatsuro MATSUOKA <tmacchant>
Thu 11 Aug 2016 03:03:51 PM UTC, comment #33: 

And a follow up to comment #32, can we close this report now?  The original issue was that no file at all was created.  Now, a file is created, but the resulting file may not be 100% emf compliant as MS Paint fails to read it.

As another test, what about an emf file created on Linux and copied to a Windows machine?  If that can't be read by MS Paint 10 then it is a problem with fig2dev and we should just stop since that is an upstream problem.

Rik <rik5>
Group administrator
Thu 11 Aug 2016 11:46:18 AM UTC, comment #32: 

So now it as least consistant with the 3.6.X versions of octave?

John Donoghue <lostbard>
Group Member
Thu 11 Aug 2016 08:22:53 AM UTC, comment #31: 

I have tried
fig2dev -L emf test.fig testx.emf

by fig2dev embedded on octave-3.6.4 msvc
and fig2dev on cygwin.

The produced emf files were rejected by MS-paint but accepted by other software.

Tatsuro MATSUOKA <tmacchant>
Thu 11 Aug 2016 05:57:03 AM UTC, comment #30: 


plot(1:10)
print -depsc test.eps


Execute "system bash"

$ pstoedit -f emf test.eps test.emf
$ pstoedit -f fig test.eps test.fig
$ fig2dev -L emf test.fig test2.emf


test.emf accepted by MS-paint
test2.emf rejected by MS-paint

So this is fig2dev  issue.


Tatsuro MATSUOKA <tmacchant>
Thu 11 Aug 2016 04:19:21 AM UTC, comment #29: 

Created emf file rejected by MS paint on windows 10.
(Both 64 and 32 bit build.)

But it is accepted by XnView, MS-word 2010, and Libre-Office draw 5.1.4 and inkscape 0.91.

Hmmmm!

Tatsuro MATSUOKA <tmacchant>
Wed 10 Aug 2016 11:52:49 AM UTC, comment #28: 

On win32 (at least machine) it now creates a non 0 length file, however on trying to display it in paint, it says it is not a valid file

John Donoghue <lostbard>
Group Member
Wed 10 Aug 2016 08:58:03 AM UTC, comment #27: 

The change to pstoedit for mxe build by John Donoghue 
http://hg.octave.org/mxe-octave/rev/cc549d1865cb


seem to fix the issue.

On 64 bit binary of development branch source, now the below works. 


plot (1:10)
print test.emf

produces correct emf file.

Tatsuro MATSUOKA <tmacchant>
Tue 26 Jul 2016 03:21:57 PM UTC, comment #26: 

Pushed updated transfig  http://hg.octave.org/mxe-octave/rev/a7e6025bcb39

Pending change need still for pstoedit


John Donoghue <lostbard>
Group Member
Fri 22 Jul 2016 12:09:28 PM UTC, comment #25: 

Since we build gs for both win64 and win32, we can probally change pstoedit to use it instead of the others.

Actually, perhaps making it look for envvar of GS first, like it does in Linux would be a good idea.

John Donoghue <lostbard>
Group Member
Fri 22 Jul 2016 10:34:25 AM UTC, comment #24: 

For octave 4.0.3 32bit (from official site), I copy gs.exe to gswin32c.exe (keeping gs.exe) and I replace fig2dev.exe with that octave-3.6.4 msvc.

plot (1:10)

"save as" to emf gave correct emf file.

and

 print(gcf, 'figure1.emf', '-demf', '-debug')

gave correct emf file.

For 64 bit octave, I still have empty emf file.

At least 32 bit, working fig2dev and addition gswin32c.exe solve the issue.

Perhaps we have to apply more patches to pstoedit source if we use gs.exe but not gswin32c.exe

Tatsuro MATSUOKA <tmacchant>
Fri 22 Jul 2016 04:18:54 AM UTC, comment #23: 

Can't load c:\mingw\gs\bin\gsdll32.dll (possibly due to 32/64 bit mix - will try gswin32c.exe instead

gswin32c.exe is usual ghostscript name for windows but gs.exe on octave for windows.

I remember the below

http://wiki.octave.org/Octave_for_Microsoft_Windows#Printing_.28installing_Ghostscript.29


If the 64 bit version of Ghostscript is installed, Octave will not automatically detect it. To use the 64 bit version an option telling Octave about it must be passed to the print command. For example to produce PDF output for a figure, using the 64 bit version of Ghostscript, the command below may be used.
 print -Ggswin64c.exe figure.pdf

Tatsuro MATSUOKA <tmacchant>
Thu 21 Jul 2016 09:07:32 PM UTC, comment #22: 

For comment #21, that's updating to fig2dev 3.2.6

John Donoghue <lostbard>
Group Member
Thu 21 Jul 2016 09:06:26 PM UTC, comment #21: 

Out of interest sake, I tried updating to 3.2.6

cat testfig.fig | fig2dev.exe -L emf > testfig2.emf - works in this version

cat testfig.ps | pstoedit.exe -gs /usr/bin/gs.exe -f fig | fig2dev.exe -L emf > testfig.emf - works

Also works! So a step in the right direction.

In octave, print(gcf, 'figure1.emf', '-demf', '-debug') still gives an empty file, but:

Note the '-gs /usr/bin/gs' in pstoedit - without it:


Can't load c:\mingw\gs\bin\gsdll32.dll (possibly due to 32/64 bit mix - will try gswin32c.exe instead

The interpreter seems to have failed, cannot proceed !.exe'


 
So the zero size emf file appears to be a secondary issue - tis time with pstoedit trying to load the wrong ghostscript.

Looking now  at how pstoedit decides to pick what gs to run.

John Donoghue <lostbard>
Group Member
Thu 21 Jul 2016 12:06:17 PM UTC, comment #20: 

I bet the issue is not being in binary mode when writing to stdout then

John Donoghue <lostbard>
Group Member
Thu 21 Jul 2016 11:53:54 AM UTC, comment #19: 

Can you also attach the emf file generated from your current vs 3.6.4 version ?

John Donoghue <lostbard>
Group Member
Thu 21 Jul 2016 11:06:28 AM UTC, comment #18: 

$ C:/Software/Octave-3.6.4/bin/fig2dev -h
fig2dev Version 3.2 Patchlevel 5d

Tatsuro MATSUOKA <tmacchant>
Thu 21 Jul 2016 10:25:30 AM UTC, comment #17: 

What version of fig2dev is in 3.6.4 ?

John Donoghue <lostbard>
Group Member
Wed 20 Jul 2016 11:39:49 PM UTC, comment #16: 

Using fig2dev embedded msvc version octave-3.6.4 pipe works
(I have also confirmed that pipe does not work on the current one.)


cat testfig.fig | C:/Software/Octave-3.6.4/bin/fig2dev -L emf > testfig3.emf

makes correct output.

I have compared correct emf with broken one using a binary editor.
The broken one have a additional 0x0d code to the correct one.
I delete this additional 0x0d and saved.
Then the file can be open as emf file.

As long as fig2dev on octave-3.6.4 on msvc works correct so that we might fix fig2dev on mingw. (Perhaps need patch)



Tatsuro MATSUOKA <tmacchant>
Wed 20 Jul 2016 09:24:27 PM UTC, comment #15: 


cat testfig.ps | pstoedit.exe -gs /usr/bin/gs.exe -f fig | fig2dev.exe -L emf > testfig2.emf  .... Gives an invalid 3k file



fig2dev.exe -L emf testfig.fig testfig2.emf ..... works


cat testfig.fig | fig2dev.exe -L emf > testfig2.emf gives invalid 3k file


Running cat testfig.fig | fig2dev.exe -L emf  .... shows binary ending with string 'fig2dev: error: failed to write EMF header'



Running:

C:\Octave\Octave-4.0.3\bin\fig2dev.exe: option requires an argument -- x

Usage: C:\Octave\Octave-4.0.3\bin\fig2dev.exe [-L language] [-f font] [-s size] [-m scale] [input [output]]


So the windows fig2dev doesn't support pipes ?


John Donoghue <lostbard>
Group Member
Wed 20 Jul 2016 09:12:43 PM UTC, comment #14: 



In octave doing:


plot([0 10])
print ('testfig.ps')


Then via command line:



pstoedit.exe -gs /usr/bin/gs.exe -f fig testfig.ps > testfig.fig
fig2dev.exe -L emf testfig.fig testfig.emf
fig2dev.exe -L png testfig.fig testfig.png


I can load testfig.emf in paint and it is ok.
I can load testfig.png and it is ok

Running in octave:


>> print(gcf, 'figure1.emf', '-demf', '-debug')
pstoedit command: 'C:\Octave\Octave-4.0.3\bin\pstoedit.exe -f fig 2> NUL'
fig2dev command: 'C:\Octave\Octave-4.0.3\bin\fig2dev.exe -L emf 2> NUL'
opengl-pipeline: 'C:\Octave\Octave-4.0.3\bin\pstoedit.exe -f fig 2> NUL | C:\Octave\Octave-4.0.3\bin\fig2dev.exe -L emf 2> NUL > figure1.emf'
>>


I get an empty file.



John Donoghue <lostbard>
Group Member
Wed 01 Jun 2016 12:31:46 AM UTC, comment #13: 

I come from the below

http://octave.1599824.n4.nabble.com/print-to-emf-issue-on-qt-and-fltk-4-0-on-windows-td4677269.html


t = 0:0.1:6.3;
plot (t, cos(t), '-;cos(t); ', t, sin(t), '+3;sin(t); ');
print ('test.emf','-demf', '-FArial:12');


creates incorrect emf file.

# But octave-4.0.2 x64 and octave-4.1.0+ x64 gives empty emf file.
# Both two are created by me using mxe-octave.
# I will file this the other item.

I think this is directly related to comment #11:.
If I use fig2dev provided in octave-3.6.4 msvc, it produces correct emf.


C:\octave\Octave-4.0.0\bin\pstoedit -f fig test.eps >  test.fig
C:\Software\Octave-3.6.4\bin\fig2dev -L emf test.fig > test.emf


Therefore this is fig2dev issue that produced by the mxe-octave as already mentioned.

Tatsuro MATSUOKA <tmacchant>
Sun 01 Mar 2015 07:21:15 PM UTC, comment #12: 

ok - probally an issue with fig2dev then. I will take a look at some stage

John Donoghue <lostbard>
Group Member
Sun 01 Mar 2015 04:00:45 PM UTC, comment #11: 

In comment #10, there is a typo.  The output format from pstoedit should be '-f fig' rather than '-f fix'.

I can now print a file with the .emf extension, but the resulting file won't load in an EMF viewer (But, it is not 0 bytes).

If I go through the individual steps I get working files along the way until the conversion from .fig format to .emf format.

In Octave,


plot (1:10)
print -depsc tst1.ps


On command line


c:\Octave\Octave-3.9.1+\bin\pstoedit.exe -f fig tst1.ps > tst1.fig
c:\Octave\Octave-3.9.1+\bin\fig2dev.exe -L emf tst1.fig > tst1.emf


Interestingly, I can take the individual files over to Linux and they are correct.  tst1.ps displays correctly.  xfig shows a rendering of the fig, altough the background is wrong.  Finally, if I use fig2dev to convert tst1.fig to a different format, including emf, the resulting file is fine.  I think there must be something wrong with fig2dev.exe on the Windows side.

I tried using fig2dev.exe on Windows to convert to other formats and at first it fails because there is no 'gs.exe' in the path.  I added 'C:\octave\octave-3.9.1+\bin' to the path and now the command will complete, but none of the outputs are any good.

It's probably not worth figuring this out before the 4.0 release this is a seldom used format.

Rik <rik5>
Group administrator
Sun 01 Mar 2015 12:12:21 AM UTC, comment #10: 

On running for emf.


>> print -debug test4.emf
pstoedit command: 'C:\Octave\Octave-3.9.1+\bin\pstoedit.exe -f fig 2> NUL'
fig2dev command: 'C:\Octave\Octave-3.9.1+\bin\fig2dev.exe -L emf 2> NUL'
opengl-pipeline: 'C:\Octave\Octave-3.9.1+\bin\pstoedit.exe -f fig 2> NUL | C:\Octave\Octave-3.9.1+\b
in\fig2dev.exe -L emf 2> NUL > test4.emf'


A empty test4.emf file is created.


From comment 7.

bash-3.1$ pstoedit.exe -f fix mytest.ps > test.fig
pstoedit: version 3.70 / DLL interface 108 (built: Feb 28 2015 - release build -
 g++ 4.9.2 - 32-bit) : Copyright (C) 1993 - 2014 Wolfgang Glunz
bash-3.1$


Created .fig file with a:
Unsupported output format fix

followed by the supported formats (see comment 8)


And


bash-3.1$ pstoedit.exe -f emf mytest.ps  test.emf
pstoedit: version 3.70 / DLL interface 108 (built: Feb 28 2015 - release build -
 g++ 4.9.2 - 32-bit) : Copyright (C) 1993 - 2014 Wolfgang Glunz
Can't load c:\mingw\gs\bin\gsdll32.dll (possibly due to 32/64 bit mix - will try
 gswin32c.exe instead
running-win command line: c:\mingw\gs\bin\gswin64c.exe -q -dDELAYBIND -dWRITESYS
TEMDICT -dNODISPLAY -dNOEPS C:/Users/JDONOG~1.ECE/AppData/Local/Temp/psin2
Interpreter failure: -1
PostScript/PDF Interpreter finished. Return status -1 executed command : c:\ming
w\gs\bin\gsdll32.dll -q -dDELAYBIND -dWRITESYSTEMDICT -dNODISPLAY -dNOEPS C:/Use
rs/JDONOG~1.ECE/AppData/Local/Temp/psin2
The interpreter seems to have failed, cannot proceed !


Where I am not sure where c:\mingw\gs\bin\gsdll32.dll or  c:\mingw\gs\bin\gswin64c.exe comes from, but neither exists, so need to keep looking.


John Donoghue <lostbard>
Group Member
Sat 28 Feb 2015 11:58:17 PM UTC, comment #9: 

Current compiled pstoedit in mxe:


Default interpreter is c:\mingw\gs\bin\gsdll32.dll
Available formats :
        psf:                        .fps:        Flattened PostScript (no curves)         (built-in)
-------------------------------------------
        ps:                        .spsc:        Simplified PostScript with curves         (built-in)
-------------------------------------------
        debug:                        .dbg:        for test purposes         (built-in)
-------------------------------------------
        dump:                        .dbg:        for test purposes (same as debug)         (built-in)
-------------------------------------------
        gs:                        .gs:        any device that Ghostscript provides - use gs:format, e.g. gs:pdfwrite         (built-in)
-------------------------------------------
        ps2ai:                        .ai:        Adobe Illustrator via ps2ai.ps of Ghostscript         (built-in)
-------------------------------------------
        gmfa:                        .meta:        ASCII GNU metafile          (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        gmfb:                        .meta:        binary GNU metafile          (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot:                        .plot:        GNU libplot output types, e.g. plot:-plotformat X         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot-cgm:                .cgm:        cgm via GNU libplot         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot-ai:                .ai:        ai via GNU libplot         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot-svg:                .svg:        svg via GNU libplot         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot-ps:                .ps:        ps via GNU libplot         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot-fig:                .fig:        fig via GNU libplot         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot-pcl:                .pcl:        pcl via GNU libplot         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot-hpgl:                .hpgl:        hpgl via GNU libplot         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        plot-tek:                .tek:        tek via GNU libplot         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvlplot-0.dll)
-------------------------------------------
        sample:                        .sam:        sample driver: if you do not want to see this, uncomment the corresponding line in makefile and make again         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        idraw:                        .idraw:        Interviews draw format (EPS)         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        fig:                        .fig:        .fig format for xfig         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        xfig:                        .fig:        .fig format for xfig         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        tfig:                        .fig:        .fig format for xfig         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        tgif:                        .obj:        Tgif .obj format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        gnuplot:                .gnuplot:        gnuplot format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        svm:                        .svm:        StarView/OpenOffice.org metafile         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        vtk:                        .vtk:        VTK driver: if you do not want to see this, uncomment the corresponding line in makefile and make again         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        tk:                        .tk:        tk and/or tk applet source code         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        cfdg:                        .cfdg:        Context Free Design Grammar         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        gschem:                        .gschem:        gschem format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        pcbfill:                .pcbfill:        pcb format with fills         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        pcb:                        .pcb:        pcb format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        pcbi:                        .dat:        engrave data - insulate/PCB format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        hpgl:                        .hpgl:        HPGL code         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        pcl:                        .pcl:        PCL code         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        pic:                        .pic:        PIC format for troff et.al.         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        noixml:                        .xml:        Nemetschek NOI XML format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        latex2e:                .tex:        \LaTeX2e picture format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        mma:                        .m:        Mathematica graphics         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        asy:                        .asy:        Asymptote Format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        mpost:                        .mp:        MetaPost format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        sk:                        .sk:        Sketch format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        text:                        .txt:        text in different forms          (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        kil:                        .kil:        .kil format for Kontour         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        pdf:                        .pdf:        Adobe's Portable Document Format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        java2:                        .java2:        java 2 source code         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        java1:                        .java:        java 1 applet source code         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        dxf:                        .dxf:        CAD exchange format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        dxf_s:                        .dxf:        CAD exchange format with splines         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        rpl:                        .rpl:        Real3D Programming Language format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        rib:                        .rib:        RenderMan Interface Bytestream         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        lwo:                        .lwo:        LightWave 3D object format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        cairo:                        .c:        cairo driver         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        gcode:                        .gcode:        emc2 gcode format         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvstd-0.dll)
-------------------------------------------
        wmf:                        .wmf:        MS Windows Metafile         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvwmf-0.dll)
-------------------------------------------
        emf:                        .emf:        Enhanced MS Windows Metafile         (c:\octave\octave-3.9.1+\bin/../lib/pstoedit\libp2edrvwmf-0.dll)
-------------------------------------------


John Donoghue <lostbard>
Group Member
Fri 27 Feb 2015 09:53:26 PM UTC, comment #8: 

Related to this, pstoedit appears to attempt to read every dll in the bin folder and see if they are plugins or not, so it may be loading msys-1.dll when it does not need to.

I have an update I will push that changes where it looks for the plugins and uses libplot that I will push up.

Still no libEMF yet.

John Donoghue <lostbard>
Group Member
Thu 26 Feb 2015 04:15:40 AM UTC, comment #7: 

Another clue is that the MXE log file for building pstodeit contains these lines


pstoedit:configure: WARNING: ** libplotter driver is disabled.
pstoedit:configure: WARNING: ** libming driver is disabled.
pstoedit:configure: WARNING: ** libpptx driver is disabled.
pstoedit:configure: WARNING: ** Cannot find libEMF. libEMF supports are disabled.
pstoedit:configure: WARNING: ** Cannot find emf.h. libEMF supports are disabled.


Obviously, we can't have EMF output if libemf is missing.  This will require installing another package in the MXE Octave build.

Rik <rik5>
Group administrator
Sun 15 Feb 2015 12:12:22 AM UTC, comment #6: 

This bug is fairly complicated, and not worth resolving for the 4.0 release.

The first problem is that pstoedit, the first command in a pipeline chain, fails to run with
 

*** Couldn't reserve space for cygwin's heap, Win32 error 6


Searching the web this seems to be because the base library file msys-1.0.dll was not compiled to be position independent.  I downloaded a rebase.exe utility and executed


cd C:\Octave\Octave-3.9.1+\bin>
rebase -b 0x30000000 msys-1.0.dll


This allows the pstoedit command to run.  When I do


pstoedit.exe -f fix tst.ps > tst.fig


the command apparently succeeds.  But if you look at the file it actually contains an error message.  The error message says the fig file format is not supported.  In fact, the range of file formats is incredibly small.


Unsupported output format fig
Available formats :
        psf:                        .fps:        Flattened PostScript (no curves)         (built-in)
-------------------------------------------
        ps:                        .spsc:        Simplified PostScript with curves         (built-in)
-------------------------------------------
        debug:                        .dbg:        for test purposes         (built-in)
-------------------------------------------
        dump:                        .dbg:        for test purposes (same as debug)         (built-in)
-------------------------------------------
        gs:                        .gs:        any device that GhostScript provides - use gs:format, e.g. gs:pdfwrite         (built-in)
-------------------------------------------
        ps2ai:                        .ai:        Adobe Illustrator via ps2ai.ps of GhostScript         (built-in)
-------------------------------------------


On linux, using pstoedit -help I and extracting the reference to fig


       plot-fig:               .fig:   fig  via GNU libplot    (/usr/lib/pstoedit/libp2edrvlplot.so)
This driver supports the following additional options: (specify using -f "format:-option1 -option2")
[          plotformat    : string        : plotutil format to generate]


This seems to difficult, and too inconsequential, to solve for the 4.0 release.

However, if we get around to it it seems that we need to compile msys with a position independent flag and then we needto check about adding libplot support to MXE Octave.  I've added John D. to the CC list just so he knows about this issue.




Rik <rik5>
Group administrator
Wed 04 Feb 2015 06:25:08 AM UTC, comment #5: 

Works on Linux, still fails in Windows.

Rik <rik5>
Group administrator
Sat 11 Jan 2014 10:18:59 PM UTC, comment #4: 

Fails for me with an MXE build of the current 3.8.0 release. Could be due to this error (pstoedit is called as part of the pipeline for fltk):


pstoedit -f fig test.ps test.fig
 *** Couldn't reserve space for cygwin's heap, Win32 error 6


Mike Miller <mtmiller>
Group Member
Tue 18 Jun 2013 02:38:40 PM UTC, comment #3: 

I have the same problem with version 3.6.4: No file is produced when the graphics_toolkit is fltk.  Gnuplot works.

Here is output from your suggested test, after I removed "2> NUL" from the print.m command to see the error:

octave:94> graphics_toolkit
ans = fltk
octave:95> plot(1:10)
octave:96> print("-debug", "test4.emf")
pstoedit command: 'C:\Octave\Octave3.6.4_gcc4.6.2\pstoedit/pstoedit.exe -f fig'
fig2dev command: 'C:\Octave\Octave3.6.4_gcc4.6.2\fig2dev/fig2dev.exe -L emf'
fltk-pipeline: 'C:\Octave\Octave3.6.4_gcc4.6.2\pstoedit/pstoedit.exe -f fig | C:\Octave\Octave3.6.4_gcc4.6.2\fig2dev/fig2dev.exe -L emf > test4.emf'
'C:\Octave\Octave3.6.4_gcc4.6.2\pstoedit' is not recognized as an internal or external command,
operable program or batch file.
octave:97>


The pstoedit.exe command seems to be specified correctly by the full path to the pstoedit subdirectory.  I can't figure out why it's getting stuck here.

Carl <costerwi>
Fri 18 Jan 2013 01:54:12 PM UTC, comment #2: 

Are you using the MinGW, MSys or cygwin build?
Which backend are you using?

If FLTK, try switching to gnuplot:

$ graphics_toolkit gnuplot
$ print("test3.emf")

please post the output (after a fresh start from octave) of
$ graphics_toolkit
$ plot(1:10)
$ print("-debug","test4.emf")

you can then see the commands which are run and try to run them on a console if you want to debug this yourself.

Regards, Andy

Andreas Weber <andy1978>
Group Member
Fri 14 Sep 2012 01:58:16 AM UTC, comment #1: 

Confirming this behaviour with 3.6.2 on XP SP3.

No output produced using these commands:

plot([1 2],[3 6]);
print(gcf,'test_emf','-demf');
print(gcf,'test_meta','-demf');

These devices work OK: ps2, eps2, tex, aifm, dxf, hpgl, png, jpg, svg, pdf.

John Harrison <jph01>
Wed 08 Aug 2012 09:41:16 AM UTC, original submission:  

Using Octave 3.6.2 on Windows

print(1, 'figure1.emf') 

Nothing happens when using saveas and print to save a plot in figure(1) as .emf or meta formats

However saveas and print works for .bmp, .gif .jpg and the files are saved correctly (but process is slow)

No issues when using older version 3.2.x

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tmacchant (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by costerwi (Posted a comment)
  • -email is unavailable- added by andy1978 (Posted a comment)
  • -email is unavailable- added by jph01 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-11 rik5 StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2016-07-20 lostbard Assigned toNone lostbard
    2015-06-04 mtmiller Release3.6.2 dev
    2015-02-15 rik5 Carbon-Copy- Added lostbard
    2014-01-11 mtmiller CategoryPlotting Plotting with OpenGL
        Item GroupNone Incorrect Result
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code