Difference between revisions of "File types"

From Inkscape Wiki
Jump to navigation Jump to search
(Added HP-GL2)
 
(28 intermediate revisions by 13 users not shown)
Line 12: Line 12:
  
 
* Enhanced Windows Metafile (emf)
 
* Enhanced Windows Metafile (emf)
 +
* Windows Metafile (wmf) (there are a lot of clipart packages in this format)
 
* Computer Graphics Metafile (cgm)
 
* Computer Graphics Metafile (cgm)
 
* [http://lprng.sourceforge.net/DISTRIB/RESOURCES/HPGL_short_summary.html HP-GL2 ](plt)
 
* [http://lprng.sourceforge.net/DISTRIB/RESOURCES/HPGL_short_summary.html HP-GL2 ](plt)
 +
* [[Embroidery file formats]] (Ksm, Melco, PCS, PES, Tajima,...) ???
 +
* CorelDRAW files (cdr). Their UI is quite similar to Inkscape's (owing to inspiration of both by Xara's ancient Artworks for the Acorn Archimedes); it suggests a path of least resistance for those seeking to convert.
 +
* The newer Macromedia Freehand formats: .fh9, .fh10, and .fh11 (by file extension in Windows). At least the ability to read basic vectors, fill color, and stroke width (while possibly ignoring page layout for compatibility). Versions older than Freehand 8 might also be useful to revive those ancient drawings one made using the original Apple Macintoshes (prior to His Steveness' firing and subsequent rehiring).
 +
 +
== Converter Status ==
 +
 +
Please check [http://inkscape.org/wiki/index.php/SVG_Test_Suite_Compliance] and [http://www.w3.org/Graphics/SVG/Test/]
 +
 +
{| border="1"
 +
|+ Inkscape export feature matrix
 +
! Test !! Inkscape !! PDF native !! PDF cairo !! PS native !! PS cairo !! emf
 +
|-
 +
! Stroke and Fill
 +
|-
 +
! shapes-ellipse-01-t
 +
| ok || || ok || || crash || ok
 +
|-
 +
! shapes-ellipse-02-t
 +
| ok || || ok || || crash ||
 +
|-
 +
! Markers
 +
|-
 +
! Text
 +
|-
 +
! text-align-01-b
 +
| ok || || ok || || crash || ok
 +
|-
 +
! SVG Filter
 +
|-
 +
! basic-filters-gauss-01-b
 +
| ok || || fail || || crash ||
 +
|-
 +
|}
  
 
== Existing Conversion Tools ==
 
== Existing Conversion Tools ==
Line 19: Line 53:
 
Scripts and other applications that provide conversions, and might be useful to investigate as solutions to this dilemma.
 
Scripts and other applications that provide conversions, and might be useful to investigate as solutions to this dilemma.
  
* [http://www.solidcode.net/pdf2svg/ pdf2svg]
+
* [http://www.solidcode.net/pdf2svg/ pdf2svg] (broken link)
* [http://jeff.cs.mcgill.ca/~luc/PSto.html PS to other formats page]
+
* [http://jeff.cs.mcgill.ca/~luc/PSto.html PS to other formats page] (link broken)
 
* [http://www.cenon.info/frame_gb.html Cenon has importers/exporters and source to match]
 
* [http://www.cenon.info/frame_gb.html Cenon has importers/exporters and source to match]
 
* [http://freshmeat.net/projects/epd2svg/ EPD to SVG]
 
* [http://freshmeat.net/projects/epd2svg/ EPD to SVG]
Line 28: Line 62:
 
* [http://freshmeat.net/projects/fti2svg.pl/ SGI Irix FTI vector icons to SVG]
 
* [http://freshmeat.net/projects/fti2svg.pl/ SGI Irix FTI vector icons to SVG]
 
* [http://www.graphviz.org/ Graphviz] - popular text format for describing graphs. Can export SVG.
 
* [http://www.graphviz.org/ Graphviz] - popular text format for describing graphs. Can export SVG.
* [http://www.pstoedit.net/pstoedit pstoedit] - converts Postscript into SVG (and other editablke formats
+
* [http://www.pstoedit.net/pstoedit pstoedit] - converts Postscript into SVG (and other editable formats)
 
* [http://www.wizards.de/~frank/pstill.html PStill] converts Postscript into PDF
 
* [http://www.wizards.de/~frank/pstill.html PStill] converts Postscript into PDF
 +
* [http://homepage.ntlworld.com/r.inglis/PH/Rshi/svg/ ps2svg.ps] converts Postscript into SVG (free) (broken link)
 +
* [http://www.gnu.org/software/hp2xx/ hp2xx] converts HPGL files into various formats, including SVG
 +
* [http://sk1project.org/modules.php?name=Products&product=uniconvertor UniConvertor] convert CDR-family, AI,PS, EPS, WMF, CGM, SVG to AI, WMF, CGM, SVG
 +
* [http://www.scribus.net/ Scribus] EPS to SVG (at least)
  
 
== OpenOffice OODraw-to-SVG ==
 
== OpenOffice OODraw-to-SVG ==
  
OpenOffice can export '''to''' SVG, and import SVG using the following plug-in
+
OpenOffice can export and import SVG, but they do not always work.
 +
 
 +
For the SVG import in Open Office, do not use the import-from-file function. Instead, open the SVG, and copy it to your document.
  
http://www.ipd.uni-karlsruhe.de/~hauma/svg-import/
 
 
 
 
Possibly a filter could be created for Inkscape from their code,
 
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
 
to enable at least being able to load OODraw's SXD file format into
Inkscape.
+
Inkscape.
 
 
Workaround to use SVG-files created with Inkscape in Openoffice.org.
 
Download Skencil from www.skencil.org (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: http://www.tokonoma.de/software/svg_to_ooo/svg_to_ooo.html
 
  
 
Browsing through OO's sourcecode, this appears to be the parts
 
Browsing through OO's sourcecode, this appears to be the parts

Latest revision as of 17:14, 21 February 2020

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)
  • Windows Metafile (wmf) (there are a lot of clipart packages in this format)
  • Computer Graphics Metafile (cgm)
  • HP-GL2 (plt)
  • Embroidery file formats (Ksm, Melco, PCS, PES, Tajima,...) ???
  • CorelDRAW files (cdr). Their UI is quite similar to Inkscape's (owing to inspiration of both by Xara's ancient Artworks for the Acorn Archimedes); it suggests a path of least resistance for those seeking to convert.
  • The newer Macromedia Freehand formats: .fh9, .fh10, and .fh11 (by file extension in Windows). At least the ability to read basic vectors, fill color, and stroke width (while possibly ignoring page layout for compatibility). Versions older than Freehand 8 might also be useful to revive those ancient drawings one made using the original Apple Macintoshes (prior to His Steveness' firing and subsequent rehiring).

Converter Status

Please check [1] and [2]

Inkscape export feature matrix
Test Inkscape PDF native PDF cairo PS native PS cairo emf
Stroke and Fill
shapes-ellipse-01-t ok ok crash ok
shapes-ellipse-02-t ok ok crash
Markers
Text
text-align-01-b ok ok crash ok
SVG Filter
basic-filters-gauss-01-b ok fail crash

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 and import SVG, but they do not always work.

For the SVG import in Open Office, do not use the import-from-file function. Instead, open the SVG, and copy it to your document.

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.

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

OpenOffice/filter/source/svg

SOTranscoder.java  svgfilter.cxx      svgimport.cxx  svgwriter.hxx
exports.map        svgfilter.hxx      svgscript.hxx
makefile.mk        svgfontexport.cxx  svguno.cxx
svgexport.cxx      svgfontexport.hxx  svgwriter.cxx

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

http://www.mirror.ac.uk/downloads/sunsite.dk/openoffice/contrib/rc/1.1.4rc/OOo_1.1.4rc_source.tar.gz

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

http://graphics.openoffice.org/svg/svg.htm

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

http://graphics.openoffice.org/svg/SVGExportTest.java

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

The page also includes a binary svgexport.so 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 svgexport.so 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:

      linux-gate.so.1 =>  (0xffffe000)
       libsvx645li.so => not found
       libxo645li.so => not found
       libgo645li.so => not found
       libj645li_g.so => not found
       libvcl645li.so => not found
       libutl645li.so => not found
       libtl645li.so => not found
       libcomphelp3gcc3.so => not found
       libcppuhelpergcc3.so.3 => not found
       libcppu.so.3 => not found
       libsal.so.3 => not found
       libdl.so.2 => /lib/libdl.so.2 (0x4003d000)
       libpthread.so.0 => /lib/libpthread.so.0 (0x40040000)
       libm.so.6 => /lib/libm.so.6 (0x40091000)
       libstlport_gcc.so => not found
       libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 (0x400b4000)
       libc.so.6 => /lib/libc.so.6 (0x4017d000)
       /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
       libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libgcc_s.so.1 (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
               -dUseFlateCompression=true
               -dColorConversionStrategy=/UseDeviceDependentColor
               -dDownsampleColorImages=false
               -dDownsampleGrayImages=false
               -dDownsampleMonoImages=false
               -dAutoFilterColorImages=false
               -dAutoFilterGrayImages=false
               -dColorImageFilter=/FlateEncode
               -dGrayImageFilter=/FlateEncode
               -dMonoImageFilter=/FlateEncode
               input.ps output.pdf

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 input.ps