pstoedit (ghostscript) error converting PDF to DXF

pstoedit 3.70-5.22-x86-64 from leap 42.3 standard repo

Tested with:

ghostscript 9.15-13.14-x86_64 from leap 42.3 standard repo,
ghostscript 9.15-14.3.1-x86_64 from leap 42.3 update repo, or
ghostscript 9.22-97.1-x86_64 from leap 42.3 printing repo

With either ghostcript version installed, an attempt to convert a pdf file to dxf (drawing exchange format) throws an error:

Version 9.15-13:

:~> pstoedit -nb -f dxf:-mm DE-HS-2-MET-001_REV_0.pdf DE-HS-2-MET-001_REV_0.dxf
pstoedit: version 3.70 / DLL interface 108 (built: Jul  8 2017 - release build - g++ 4.8.5 - 64-bit) : Copyright (C) 1993 - 2014 Wolfgang Glunz
Error: /undefined in --run--
Operand stack:
   false   false   --dict:280/300(ro)(G)--   .Qqwarning_issued   false
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1950   1   3   %oparray_pop   1949   1   3   %oparray_pop   1933   1   3   %oparray_pop   1820   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1950   1   3   %oparray_pop   1949   1   3   %oparray_pop   1933   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--
Dictionary stack:
   --dict:1182/1684(G)--   --dict:1/20(G)--   --dict:302/450(L)--   --dict:302/450(L)--   --dict:116/127(ro)(G)--   --dict:280/300(ro)(G)--   --dict:26/32(L)--
Current allocation mode is global
Last OS error: No such file or directory
Current file position is 87895
GPL Ghostscript 9.15: Unrecoverable error, exit code 1
Unrecoverable error: typecheck in setpagedevice
Operand stack:
    false  false  false  --nostringval--
PostScript/PDF Interpreter finished. Return status 256 executed command : /usr/bin/gs -I/home/blimmer/.fonts -q -dNOBIND -dWRITESYSTEMDICT -dNODISPLAY -dNOEPS "/tmp/psin3fWK8C"
The interpreter seems to have failed, cannot proceed !

Version 9.15-14 gives a larger output, but fails similar to the other two. I can downgrade and post the output in necessary.

Version 9.22:

:~> pstoedit -f dxf:-mm DE-HS-2-MET-001_REV_0.pdf DE-HS-2-MET-001_REV_0.dxf                                             
pstoedit: version 3.70 / DLL interface 108 (built: Jul  8 2017 - release build - g++ 4.8.5 - 64-bit) : Copyright (C) 1993 - 2014 Wolfgang Glunz

 *** WARNING - the DELAYBIND command has been deprecated, and will be
               removed in the next version. For now you can restore
               the behaviour by using -dREALLYDEALYBIND but if you
               require continued use of this command you should contact
               the Ghostscript developers. Commercial customers of
               Artifex should email their support contact, free users
               are encouraged to talk to us on the #ghostscript IRC
               channel on irc.freenode.net.

Unrecoverable error: undefined in DELAYBIND
PostScript/PDF Interpreter finished. Return status 65280 executed command : /usr/bin/gs -I/home/blimmer/.fonts -q -dDELAYBIND -dWRITESYSTEMDICT -dNODISPLAY -dNOEPS "/tmp/psinOOcPjJ"
The interpreter seems to have failed, cannot proceed !
blimmer@bruno:~/Trabalhos em curso/PDF> man pstoedit
blimmer@bruno:~/Trabalhos em curso/PDF> pstoedit -nb -f dxf:-mm DE-HS-2-MET-001_REV_0.pdf DE-HS-2-MET-001_REV_0.dxf
pstoedit: version 3.70 / DLL interface 108 (built: Jul  8 2017 - release build - g++ 4.8.5 - 64-bit) : Copyright (C) 1993 - 2014 Wolfgang Glunz
Error: /undefined in .currentglobal
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1999   1   3   %oparray_pop   1998   1   3   %oparray_pop   1982   1   3   %oparray_pop   1868   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:980/1684(G)--   --dict:0/20(G)--   --dict:130/200(L)--
Current allocation mode is local
Current file position is 6949
GPL Ghostscript 9.22: Unrecoverable error, exit code 1
PostScript/PDF Interpreter finished. Return status 256 executed command : /usr/bin/gs -I/home/blimmer/.fonts -q -dNOBIND -dWRITESYSTEMDICT -dNODISPLAY -dNOEPS "/tmp/psin4JQ92L"
The interpreter seems to have failed, cannot proceed !

From pstoedit depends on Ghostscript, but dependency is broken by Ghostscript 9.22 · Issue #15 · pmonta/gerber2graphtec · GitHub

… Ghostscript 9.22 depreciates the -dDELAYBIND flag which pstoedit depends on. The result is no output from pstoedit. pstoedit and this project haven’t seen any development in while so I don’t expect this will magically be fixed.

Downgrading Ghostscript to 9.21 seems the logical answer,but …

It looks like this upstream bug that should be fixed, but apparently isn’t: https://bugs.ghostscript.com/show_bug.cgi?id=697846

This capability is quite important to my work, I’m stumped without it. Please help!

Thank you,

Bruno

Note: the online converters I’ve tried until now are no good, as they don’t preserve line thickness, something that pstoedit/ghostcript does.

Obs: this worked fine in openSUSE 13.2, unfortunately I upgraded all installs I had.

https://software.opensuse.org/package/ghostscript show that oS 13.2 also used ghostscript version 9.15, but it’s not available to download it from there to test Leap 42.1 and 42.2 unsupported repos have various minor versions of ghostcript 9.15, perhaps one of these will work.

If you have no objections,
Nowadays there are a variety of online services that will convert PDF to various formats.

So, for example this is one that promises to do the version for you (at no cost)
https://www.zamzar.com/convert/pdf-to-dxf/

I haven’t done your specific conversion, so don’t know if this service works well.

TSU

Version 9.15-3.9 from standard 42.1 repo works! Yast removed ghostscript-X11 package, but it didn’t seem to make a difference.

This is the oldest version I downloaded, and didn’t try the other ones (from 42.1 update and 42.2)

Thanks, but see the last line on post #1.

Perhaps then you should consider looking at alternatives to pstoedit

eg
http://getalternative.net/software/pstoedit

When software is no longer actively supported and maintained (last update to pstoedit was 3 yrs ago) you may have to find a substitute.

TSU

It seems that, Inkscape can import PDF, one page at a time, and then write the imported drawing to a DXF file: <http://wiki.inkscape.org/wiki/index.php/Current_PDF_Support>.

Hi, dcurtisfra, thanks for the tip. I tried Inkscape after updating ghostscript back to the latest in the update repo, but the conversion is partial, most of the drawing (a large one) was not converted. So, back to pstoedit for now.

For future reference, the most recent ghostscript version that works with pstoedit is 9.15-10.1, from the official (i.e., not the update) 42.2 repo. Version 9.15-11-x and newer fail.

Thanks for the suggestion. Unfortunately none of the alternatives export to DXF.

As a workaround, in the future I’ll probably keep a VM of LEAP with pstoedit and ghoscript installed when LEAP 42.3 goes EOL.

Best thing in a long while, VMs are.

Yes, (technical) CAD is, was, and will probably remain, as it is (I could be vulgar but, I’m restraining myself) … :wink:

To be perfectly honest, I’ve often given up and simply redrawn the thing with the tool at hand – after a while (with a somewhat painful posterior), one has a collection of the (technical) drawing in various file formats …

Lesson to be learnt: “Export technical drawings into as many file formats as possible.”

I don’t think so, check out BricsCAD, an excellent AutoCAD replacement for linux. Paid for, but more than worth it at less than 1/3 of the price.
It’s multi-platform, constantly updated, and has 99% of AutoCAD features, plus a few of it’s own. I can’t praise it too much.

I meant that, the file compatibility between (technical) CAD applications is mostly, time consuming. Yes, from a drawing perspective, there are a few excellent alternatives to the AutoDesk world but, moving a drawing file from one application to another is quite often, adventurous …

On 03/16/2018 10:36 AM, dcurtisfra wrote:
>
> brunomcl;2858822 Wrote:
>> I don’t think so, check out BricsCAD, an excellent AutoCAD replacement
>> for linux.
> I meant that, the file compatibility between (technical) CAD
> applications is mostly, time consuming. Yes, from a drawing perspective,
> there are a few excellent alternatives to the AutoDesk world but, moving
> a drawing file from one application to another is quite often,
> adventurous …
>
>

That’s what I.G.E.S. is supposed to do, transfer CAD data from one
application to another.


Ken
linux since 1984
S.u.S.E./openSUSE since 1996