Create SVG file with editable text

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
DanielB
Posts: 12
Joined: 2016-05-18T05:50:38-07:00
Authentication code: 1151

Create SVG file with editable text

Post by DanielB »

Hi all!

I am developing a script whose goal is to process a CSV file and generate an SVG image with color text from the text read in that CSV file. For this I am using "convert" and Pango Markup Language to color the text read from the CSV file.

On this way I get an EPS file which I then convert to PDF using epstopdf, and then convert to SVG using pdf2svg. The problem I am encountering here is that each block of text is not editable. Perhaps this happens because of the intermediate transformations. I'm not sure.

Does anyone know of any way to generate an SVG image with editable text with imagemagick or using some other process that can be automated with a script?

Thanks in advance.

Kind regards,
Daniel
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Create SVG file with editable text

Post by snibgo »

wrote:... to generate an SVG image with editable text with imagemagick...
No, that can't be done. IM processes raster images, so your final image won't have editable text, but pixels.

SVG is a text format that represents vector. Inkscape is a good place to start. Create a simple example graphically, save it as plain SVG, and look at the SVG. You script can generate similar text, or can even edit the SVG from Inkscape.
snibgo's IM pages: im.snibgo.com
DanielB
Posts: 12
Joined: 2016-05-18T05:50:38-07:00
Authentication code: 1151

Re: Create SVG file with editable text

Post by DanielB »

Hi, snibgo.
snibgo wrote: 2017-10-12T13:58:37-07:00
wrote:... to generate an SVG image with editable text with imagemagick...
No, that can't be done. IM processes raster images, so your final image won't have editable text, but pixels.

SVG is a text format that represents vector. Inkscape is a good place to start. Create a simple example graphically, save it as plain SVG, and look at the SVG. You script can generate similar text, or can even edit the SVG from Inkscape.
Thanks for the recommendation. I've been able to accomplish what I was needing with a Python library for SVG file creation and also reading some of O'Reilly's "SVG Essentials".

Thanks for your time.

Kind regards,
Daniel
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Create SVG file with editable text

Post by snibgo »

Good stuff. See also the SVG 1.1 standard, which contains many simple examples.
snibgo's IM pages: im.snibgo.com
DanielB
Posts: 12
Joined: 2016-05-18T05:50:38-07:00
Authentication code: 1151

Re: Create SVG file with editable text

Post by DanielB »

Hi, snibgo.
snibgo wrote: 2017-10-13T10:23:28-07:00 Good stuff. See also the SVG 1.1 standard, which contains many simple examples.
Yes, that is another reference that, although I still have not read yet, I was also taking it into account.

Thanks for your help.

Kind regards,
Daniel
Post Reply