problem in exporting figure object (generated from ps file)
Xfig is a diagramming tool
Brought to you by:
tklxfiguser
This problem was reported as Debian Bug #248807 by Gang Liang some time ago, but still persists in 3.2.6a.
Gang builds a Fig file, which consists of some text and an included PS file (created by LaTeX, named mytex.ps).
In xfig mytex.ps and the text can be seen side by side, while the contents of mytex.ps is replaced by a white page (after a short flash of the text at startup), when exporting with fig2dev.
The attached 248807.tar.gz contains the following files to reproduce the issue:
* mytex.fig (the FIG file)
* mytex.ps (the LaTeX based PS file embedded in mytex.fig)
* mytex-ro4.ps (the result when you fig2dev mytex.fig)
There is a button in the picture widget labelled "EPS/PS", but this is misleading. Xfig and fig2dev are really only able to import eps-files. In the source code, ps-files are dealt with as if they were eps-files. There is no trace of a differentiation between eps- and ps-file.
In the short run, this will be fixed by renaming the button from "EPS/PS" to "EPS". The documentation only mentions the import of eps-files. I am not sure, whether the import of ps-files can or will be fixed.
For the time being, a workaround is to use the pdftops program from the poppler-utils package and do
ps2pdf mytex.ps tmp.pdf; pdftops -eps tmp.pdf mytex.ps. The attached example figuremytex.figcan then be correctly converted withfig2dev -L ps mytex.fig out.ps. The commands based on ghostscript to convert a ps-file to an eps-file can not be used because these commands also compute a new, tight bounding box and crop the original image to it.A possible fix is to insert before the included ps-file
and to append after the included ps-file
The above is, besides manipulation of the comments for DSC-conformance, what the ps2epsi script that comes with ghostscript and, very similarly, the pstoeps program does. The latter has
/setpagedevice {pop} definstead of/setpagedevice /pop load def.The issue is fixed in the next release. Before including an eps or ps file, /setpagedevice is redefined to pop,
/setpagedevice {pop} def. This may allow at least some ps-files, for instance those produced by latex or those produced by fig2dev, to be embedded into output produced by fig2dev.Not related to this issue, it is now also possible to include epsi files. These are eps files which are mostly found under Windows, They have a binary header prepended and a tiff preview appended to the eps code proper.