pstoedit gives different result while converting eps to dxf using "dxf" and "dxf_14" - svg

I am using pstoedit as a part of a shell script to convert svg to dxf.
When I use pstoedit -psarg '-dNOSAFER' -dt -f 'dxf: -mm' "${epsfile}" "${dxffile}" in script, the result is like the picture below.
But when i use pstoedit -psarg '-dNOSAFER' -dt -f 'dxf_14: -mm' "${epsfile}" "${dxffile}" the result is like the picture below.
See the difference? dxf gives complete lines, but dxf_14 gives small lines not connected. I read pstohedit -help and it mentions to use dxf_14 because it's newer, but I can't if it's going to produce results like this.
I also see a bunch of options specific to dxf_14, but I'm not sure what to use. Can anyone guide me on what switches to use for dxf_14 to get desired result, like the first picture above?
PS. I'm using Inkscape to create svg and then the script converts svg to eps using inkscape cli and the pstoedit is used to convert eps to dxf, if it helps.
PS2. pstoedit version is pstoedit: version 3.74 / DLL interface 108 (built: Oct 31 2019 - release build - g++ 9.2.0 - 64-bit)

Related

what is the proper syntax of gmic apply_video

I am trying to apply a gmic filters using apply_video option of gmic utility for linux .
./gmic --apply_video 'small.mp4','-denoise 30,10' -o convert.avi
but the output is an error in terminal
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Apply command 'small.mp4,-denoise 30,10' on video stream '', with output filename '', first frame 0, last frame -1 and frame step 1.
[gmic] *** Error in ./apply_video/*local/*substitute/ *** Command '-basename': Undefined argument '$1', in expression '$1' (for 2 arguments specified).
[gmic] Command '-basename' has the following description:
-basename:
file_path,_variable_name_for_folder
Return the basename of a file path, and opt. its folder location.
When specified 'variable_name_for_folder' must starts by an underscore
(global variable accessible from calling function).
so what is the correct syntax for gmic --apply_video ?
I am using version 1.7.3
I'm using latest available version 1.7.5_pre, and I use it like this :
$ gmic -w -apply_video input.avi,\"-denoise 30,10\",0,-1,1,output.avi
For G'MIC options, you can use the excellent offline help
gmic -h
or
gmic -h -apply_video
Which as of version 1.7.8 gives
gmic: GREYC's Magic for Image Computing.
Version 1.7.8, Copyright (c) 2008-2016, David Tschumperle.
(http://gmic.eu)
-apply_video:
video_filename,_"command",_first_frame>=0,_last_frame={ >=0 | -1=last },
_frame_step>=1,_output_filename
Apply a G'MIC command on all frames of the specified input video file, in a streamed way.
If a display window is opened, rendered frames are displayed in it during processing.
The output filename may have extension '.avi' (saved as a video), or any other usual image file
extension (saved as a sequence of images).
Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1' and
'output_filename=(undefined)'.

Converting svg to png with inkscape command line failing

I feel like I must be doing something silly wrong, but I just can't get this to work. This is the command I am running from cmd:
inkscape.com "C:\path\ship.svg" -e --export-png="C:\Path\ship.png" --without-gui
In return, I get:
WARNING: File path "--export-png=C:\path\ship.png" includes directory that doesn't exist.
It does exist. What am I missing?
You should have used either -e or --export-png, not both, since they mean the same thing.
But According to the docs, -e and --export-png are no longer available. You should use -o or --export-filename=FILENAME instead. And still, you can use only one of them since -o is just the shortcut for --export-filename.
inkscape "C:\path\ship.svg" -o "C:\path\ship.png"
or
inkscape "C:\path\ship.svg" --export-filename="C:\path\ship.png"
Just an update for 2021 (it should be typed in oneline - broken down for readability only)
inkscape
--export-width=128
--export-type=png
--export-filename="C:\path\ship.png" "C:\path\build.svg"
or if you want transparent PNGs, add --export-background-opacity=0 to invocation arguments:
inkscape
--export-background-opacity=0
--export-width=128
--export-type=png
--export-filename="C:\path\ship.png" "C:\path\build.svg"
In inkscape version 1.0.2 following command will work:
inkscape --export-type="png" myfile.svg --export-filename=myfile.png

Ghostscript not prining accented characters correctly

I have a Bash script that writes a text watermark to PDF files. It does this by generating an overlay PDF with Ghostscript and then using PDFtk to stamp the overlay onto the original.
All this works perfectly, except that Ghostscript is not writing accented characters correctly. If my input text is, for example, "Français", the output on the PDF will be "Franˆ§ais".
My Ghostscript command line is:
/usr/local/bin/gs -q -o "${TEMPFILE}" \
-sDEVICE=pdfwrite -sPAPERSIZE=letter \
-c "60 23 moveto 0.32 0.23 0.22 setrgbcolor /Helvetica-Oblique findfont 9 scalefont setfont (${WATERMARK}) show"
The $WATERMARK variable contains a single line of text to be written. The problem occurs both when running the Bash script that contains this line and also when I run just this command directly.
I'm seeing this problem using Ghostscript 9.06 on Mac OS X (installed via Homebrew) and 9.05 on Ubuntu 12.04 (installed from the Ubuntu package repository). The Bash script and gs command line were both written by someone else; I have no experience using Ghostscript myself.
Changing the font has no effect on the problem and I've been unable to google anything useful related to this. What are we doing wrong here?
Thanks.
You haven't encoded the font correctly (or indeed at all).
You are assuming that the character code which represents the glyph named ccedilla is the same in the font as it is on your computer system. For Latin fonts, and the ASCII characters up to 127 this is usually true, for characters beyond that it usually isn't and for non-Latin languages (eg Russian, Arabic, CJKV languages, etc) it isn't true at all.
Encoding fonts isn't hard, but it is rather lengthy to go into here, so instead let me recommend the excellent series of articles written by John Deubert of Acumen Training, you can find them here:
http://www.acumentraining.com/acumenjournal.html
For your purposes I suggest the November and December 2001 articles.

Programmatically convert SVG shapes to paths (lineto, moveto)

I have an SVG file coming from Inkscape, Illustrator, or any other application. I want to convert the shapes to lineto, moveto, curveto format.
What I want is something like:
./Appname svgfile outfilewithpath
I will give the SVG file as an argument, then my application will convert the object into the respective paths.
Inkscape has a command-line interface. Use the Inkscape man page along with the verb source for reference:
The ObjectToPath verb converts an object to a path:
inkscape filename.svg --select=myobject --verb=ObjectToPath --export-plain-svg=filename_to_path.svg
The export-text-to-path argument converts text nodes to paths:
inkscape filename.svg --export-eps=filename.eps --export-text-to-path
These are related questions on how to run InkScape from Perl, Ruby, PHP or Python:
Using the Inkscape shell from perl
Run inkscape in PHP
Calling Inkscape in Python
Inkscape Merge Ruby Gem
This is what finally worked for me:
inkscape -f filename.svg --verb EditSelectAll --verb SelectionUnGroup --verb EditSelectAll --verb ObjectToPath --verb FileSave --verb FileQuit
It takes about 9 seconds to run and briefly opens the inkscape gui, which becomes the active application, so it's not ideal, but it's the only answer I could find that actually works.

Problems with linux Imagemagick converting PDFs to JPGs

The system I'm using uses the linux utility convert to convert pdfs to jpgs. My box gives me the following error.
>$ convert Badge-1114044091.pdf Badge-1114044091.jpg
convert: Postscript delegate failed `Badge-1114044091.pdf'.
convert: missing an image filename `Badge-1114044091.jpg'.
But the production machine does not. According to
>$ convert -version
my version is the same as the prodution machine. I'm not sure exactly how to check if postscript needs to be updated. Not really a huge linux guru.
EDIT: Upon suggestion, I checked Ghostscript. The following was already installed.
>$ gs -version
ESP Ghostscript 8.15.3 (2006-08-25)
Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.
Install GhostScript.
http://www.ghostscript.com/
ImageMagick (the 'convert' utility) doesn't actually convert PDFs; it invokes GhostScript using an arcane command like
gs -q -sDEVICE=jpeg -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -r<OUTPUT RESOLUTION> -sOutputFile=<OUTPUT>.jpg <INPUT>.pdf 2>&1
You might want to try that command directly if you want more control.

Resources