File types

From Inkscape Wiki
Revision as of 13:12, 8 August 2006 by VonHalenbach (talk | contribs) (Added HP-GL2)
Jump to navigation Jump to search

We need EPS, Adobe SVG, and PDF in/out support. We really need to import/export the following formats:

  • EPS
  • PDF
  • Adobe SVG (must be interoperable!)
  • Postscript
  • Adobe Illustrator File Formats (Newer ones are PDF 1.4 documents)

To really be considered a successful application, we must take these file formats in and be able to save them out.

Other useful formats might be:

  • Enhanced Windows Metafile (emf)
  • Computer Graphics Metafile (cgm)
  • HP-GL2 (plt)

Existing Conversion Tools

Scripts and other applications that provide conversions, and might be useful to investigate as solutions to this dilemma.

OpenOffice OODraw-to-SVG

OpenOffice can export to SVG, and import SVG using the following plug-in

Possibly a filter could be created for Inkscape from their code, to enable at least being able to load OODraw's SXD file format into Inkscape.

Workaround to use SVG-files created with Inkscape in Download Skencil from (formely sketch). It's a vector drawing application written in Python. It can import SVG and save as Computer Graphics Metafile (CGM). You can use the skconvert commandline utility to batchconvert a number of files. Openoffice is able to import CGM. Not all object types are supported and you might get wrong colors, but the path look ok. I wrote a small article about this:

Browsing through OO's sourcecode, this appears to be the parts that do the SVG writing:

OpenOffice/filter/source/svg  svgfilter.cxx      svgimport.cxx  svgwriter.hxx        svgfilter.hxx      svgscript.hxx        svgfontexport.cxx  svguno.cxx
svgexport.cxx      svgfontexport.hxx  svgwriter.cxx

You can download the OpenOffice sourcecode from one of the OpenOffice mirrors. E.g.:

There is a webpage with some info about a new SVG exporter, here:

This includes a java sample test, that could perhaps be used as a starting point for a filter...

Perhaps that could be recast into C++ so that a compiled filter could be made of it.

The page also includes a binary package. Perhaps if this is fairly stand-alone, a filter program could be written in C++ based on the above java testcode that links against and provides its functionality on the commandline as a sxd2svg tool.

nm reports that it provides the following functions:

00005f9c T component_getFactory
00005d28 T component_getImplementationEnvironment
00005d44 T component_writeInfo

ldd reports that this .so has the following dependency requirements: =>  (0xffffe000) => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => /lib/ (0x4003d000) => /lib/ (0x40040000) => /lib/ (0x40091000) => not found => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/ (0x400b4000) => /lib/ (0x4017d000)
       /lib/ => /lib/ (0x80000000) => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/ (0x40291000)

Other Conversion Tools

When doing prepress work, its better to convert from ps to pdf on the commandline. there are several options available that make the result better fit the job, this is an example ps2pdf command:

       ps2pdf12 -dProcessColorModel=/DeviceCMYK -dPDFSETTINGS=/prepress

PSStill example: convert a grayscale 25x70 cm inkscape exported postscript file to pdf:

       pstill -i -2 -c -c -c -c -t -B -w 708,66 -h 1984,25 -o output.pdf