Exporting Files

Inkscape is capable of exporting drawings to various types of vector and bitmap graphics files. Exporting methods are divided between exporting PNG (Portable Network Graphics) files and exporting to all other file formats. The PNG graphics standard is a patent unencumbered standard that is supported natively by all major web browsers and graphics programs.

[Tip]Setting Page Size to Drawing Size

You can set the page size to match the bounding box of a selection by clicking on the Fit page to selection button (v0.47) or opening the Resize page to content... section and clicking on Resize page to drawing or selection button (v0.48) in the Document Properties dialog. This is useful for setting the page size after creating an illustration. Margins can be set in v0.48.

Exporting PNG (Portable Network Graphic) Files

Exporting a PNG file is done through the Export Bitmap dialog (File icon Export Bitmap... (Shift+Ctrl+E)).

[Note]Note

This dialog ONLY exports PNG files, regardless of what file extension you use.

Export Bitmap dialog.
Export Bitmap dialog.

At the top of the dialog are four buttons that give an initial setting as to what area of the drawing should be exported (except for the Custom button, which does nothing). Once given an initial setting, the area can be adjusted.

  • Page: Export the area enclosed by the page. The default filename is the SVG filename with the svg extension replaced by png.

  • Drawing: Export all objects in drawing (including those outside the page). The initial export area is the bounding box of all the objects. The default filename is the SVG filename with the svg extension replaced by png.

  • Selection: Export the region enclosed by the bounding box surrounding the selected objects. The default filename is the internal name of the last object selected.

  • Custom: Export the area defined in the entry boxes.

The area to be exported can be modified by the entry boxes in the Export area part of the dialog. The units can be changed in the Units pull-down menu.

In the Bitmap size section of the dialog, the size of the exported bitmap can be defined. Inkscape uses a default conversion of 90 dpi. The Width, Height, or width dpi can be changed; changing one will change the others, preserving the height to width aspect ratio of the drawing.

In the Filename section, a filename can be entered or one can open a dialog to browse for a filename.

There are two options at the bottom of the dialog. The first one, Batch export n selected objects, is available if more than one object is selected. If checked, each of the selected objects will be exported into its own file. The name of the file will be the id name for the object (see XML Editor dialog) unless an object has been previously saved with a specific filename, in which case the previous filename will be used (the filename is stored under the export-filename attribute). The resolution will be 90 dpi unless previously saved with a different dpi. Note: Batch export will overwrite files without warning.

The second option, Hide all except selected, is available if one or more objects are selected. If checked all unselected objects will be hidden during export.

The following figure shows a test file exported to a PNG. The file includes basic shapes, a linear Gradient, a Pattern, a Clipping, and a blur Filter applied to text.

Export test: PNG.
Export test: PNG.
[Tip]Slicing a Drawing

To slice a drawing into pieces for use on the web, you can create an array of hidden rectangles (no Stroke or Fill) in a separate exportLayer. Save each rectangle one time to define the export filename (or change each rectangle Id with the Export Bitmap dialog prior to any exporting). Then when it is time to export the drawing, go to the export layer, use the command Edit icon Select All (Ctrl+A) to select all the rectangles in the Layer, then do a batch export.

Four slices.
Four slices created using batch export.

New in v0.48: The Slicer extension facilitates creating slices and producing the necessary CSS and HTML for their use.

[Tip]Tip
The default window size for the dialog may be too narrow to view the output filename including the directory path. Just widen the window to see the entire path.
[Warning]Rendering Errors
Inkscape v0.47 has rendering problems when two objects touch each other along a common border. This is often seen when a Pattern is used for a Fill. This has been significantly improved in v0.48. Firefox, Opera, and Batik do not have this problem. Batik can be used to produce a high-quality PNG, JPEG, or TIFF file.

Inkscape saves metadata, if included in the SVG file. Author, Copyright, Creation Time, Description, and Title fields are some of the fields saved. PNG metadata can be viewed using the ImageMagick identify command.

Exporting Other File Types

Exporting to a type other than a PNG is done through the Save As dialog (File icon Save As... (Shift+Ctrl+S)). The file type is chosen from a pull-down menu. Additional programs are required for many of the file exports. Required programs are mentioned under each file type entry.

[Note]UniConvertor

A number of export types (PLT, SK1, and WMF) use the program UniConverter. Inkscape includes this program in the Windows build. As of UniConvertor version 1.1.4 text is not exported. References to text in the drawing may prevent proper file conversion (even if converted to a path). The work-around is to convert text to path and then search the SVG file to remove references to fonts. It is planned that UniConvertor version 1.1.5 will handle text.

Note for Fedora Users: The executable uniconv was renamed to uniconvertor to avoid a naming conflict. You can add a symbolic link from /usr/bin/uniconv to /usr/bin/uniconvertor (if you don't already have a binary with that name) or you can edit files like cdr_input.inx and cdr2svg.sh in the share/inkscape/extensions directory.

[Tip]In Case of Failure

If exporting fails to work, check the file extension-errors.log located on Linux at ~/.config/inkscape/ and on Windows at %userprofile%\Application Data\Inkscape\. Any missing programs (dependencies) will be listed.

File types supported (a * indicates the author has not tested the file export):

  • .ai (Adobe Illustrator). Inkscape v0.46 and earlier supported export to the Adobe Illustrator version 8.0 file format which is a modified form of the EPS level 2 format. This support has been removed since Adobe Illustrator versions 10 (2001) and later can directly import SVG files. This is a better solution as the quality of the AI export was poor.

  • .dxf (AutoCAD, Desktop Cutting Plotters). Inkscape provides two distinct DXF export routines. The first is geared toward CAD uses and the second toward desktop cutting plotters.

    • AutoCAD DXF: This routine uses Pstoedit with Ghostscript to produce a DXF file compatible with AutoCAD release 12. This is a rather ancient file format (1992!). QCad can be used to translate the file into a more recent format. There has been a slight improvement in export in v0.48. The options available are the same as for PostScript output.

      Export test: DXF, AutoCAD.
      Export test: DXF, AutoCAD. As read in by QCad.
    • Desktop Cutting Plotter: A built-in routine is used to output files directed at desktop plotters like Wishblade and Craft ROBO. The file format is a simplified form compatible with AutoCAD release version 13 or later. One option targets Craft ROBO Desktop plotters that require an even simpler file format. Another option, added for v0.48, toggles on/off LWPOLYLINE use.

      The packages python-lxml and numpy are required.

      Save as DXF.
      DXF output dialog for Desktop Cutting Plotter routine.
      Export test: DXF, Desktop Cutting Plotter.
      Export test: DXF, Desktop Cutting Plotter. As read in by QCad.

      Note that there is a Convert to Dashes extension that turns a Path with Dashes to an identical-looking Path composed of individual sub-paths.

  • .emf (Enhanced Meta File)*. Only works with Windows. Only exports Strokes and Fills with solid colors.

  • .eps (Encapsulated PostScript). With just a few minor differences, the generation of an EPS file is identical to a PostScript file. See .ps section below details of options in the export dialog

    The major difference from an artist's perspective is that the bounding box of the EPS file is set to the smallest rectangle that fully encloses all drawn objects as per the EPS specification. Selecting Export area is page: does not change this. This unfortunate limitation is encoded in the Cairo graphics package used for PostScript, EPS, and PDF output. If you want the bounding box to match the page, you can use one of the following:

    • Include a white rectangle covering the page in the background.

    • Save as a PostScript file, changing the file extension to .eps (this should work in most cases; see following paragraph).

    • Hand-edit the %%BoundingBox line near the top of the EPS file.

    There are a couple more differences between Cairo-generated EPS and PostScript files that mostly concern experts: Both file types include a %%BoundingBox line and a showpage command. The showpage command should be ignored when an EPS file is embedded in a PostScript file. A Cairo-generated EPS file includes code to clean up after itself if it has left junk on the dictionary stack or operand stack. A Cairo-generated PS file includes an error message if the printer supports a lower PostScript level than specified in the file.

    EPS export with various options.
    A comparison of export areas. Left: An SVG drawing showing the page boundary. Note the circle is half off the page. Middle: The exported EPS file with the Export area is drawing option selected (this is the default when exporting from the command line). The bounding box is shown. Right: The exported EPS file with the Export area is drawing option not selected (this is the default when exporting from the GUI). The bounding box is shown.
  • .fx (JavaFX). Saves file in the JavaFX format via an internal Inkscape routine. No options are available. Only paths and shapes are supported. Gradients are partially supported (endpoints of Gradient are not defined). Patterns are not supported and references to them will need to be hand-edited from the FX file.

    Export test: JavaFX.
    Export test: JavaFX.
  • .gpl (Gimp Palette). Saves a list of colors used in the drawing to a Gimp Palette file. The file can then be moved to the Inkscape palette directory (share/inkscape/palettes/) and the palette can be selected in the Palette bar or the Swatches dialog. Requires PyXML module.

  • .hpgl (Hewlett-Packard Graphics Language). See also .plt format that follows. Saves file in the HPGL format, useful with various plotters and cutters. An Inkscape-supplied export routine is used. The Mirror Y-axis box should be checked to preserve the same orientation as shown in the Inkscape program.

    Save as HPGL.
    HPGL output dialog.
    Export test: HPGL.
    Export test: HPGL.
  • .odg (Open Document Graphic). Limited support, better support planned.[7] Currently only export of paths, shapes, and text is supported. Text and paths may initially be invisible. You can select them and change the Stroke style from Invisible to Continuous. Some objects may be shifted.

    Export test: ODG.
    Export test: ODG.The text was initially invisible.
  • .pdf (PDF). Inkscape uses a Cairo-based exporter. It is recommended that at least cairo 1.5.2 be used. Note, a pattern that consists of a Group created off the page may not work. Note also that the Print dialog can also be used to produce a PDF file.

    [Warning]Evince and Acroread

    Older versions of Evince, a popular Linux PostScript and PDF viewer, do not show gradients with transparency nor handle Patterns properly. Try Acroread instead. Note also that Evince PDF processing has better anti-aliasing than Evince PostScript processing.

    The Portable Document Format dialog offers a variety of options:

    • PDF Version: Only one option: PDF 1.4.

    • Convert text to paths: Characters in text strings are converted to paths. Fonts are normally subsetted and saved in the file.

    • New in v0.48:

      PDF+LaTeX: Omit text in PDF, and create LaTeX file: Creates a PDF file with text excluded and a LaTeX file with text to overlay the PDF file so that the text font matches that of the LaTeX document and LaTeX math equations in the drawing can be typeset by LaTeX. Supports text alignment and text color (with transparency). See PDF, PostScript, or EPS with LaTeX Overlay entry in this section.

    • Rasterized filter effects: Converts filter effects to bitmaps. If not enabled, objects with filters are not drawn.

    • Resolution for rasterization: Sets dpi for rasterized filter effects.

    • Export area is drawing: Sets the area for the PDF to the area that includes all the drawing elements, even if out of the Page area.

    • Export area is page: Export only objects in Page. Useful with following option.(Default when not exporting one object.)

    • Limit export to object with ID: Limits export to only the object listed. If you want to select more than one object, use a Group.

    Save as PDF.
    PDF output dialog.
    Export test: PDF.
    Export test: PDF.
  • .plt (HPGL File for desktop cutters) Saves file in a form of the HPGL format, useful with various plotters and cutters. Requires UniConverter 1.1.4. No options available.

    [Warning]Uniconverter Failure

    If you have a version of UniConvertor older than 1.1.4, conversion will silently fail, producing an SVG file instead. You can examine the file with a text editor. An SVG file will include an <?xml version...> declaration on the first line, while a PLT file will be a solid mass of letters and numbers without spaces.

    Export test: PLT.
    Export test: PLT (HPGL).
  • .png (PNG via Cairo) Saves file as a PNG via Cairo. Better export is performed using the File icon Export Bitmap... (Shift+Ctrl+E) command. This routine is mainly for testing Cairo-based export. It always adds a non-transparent white background.

    [Note]Note

    You will probably have much better results in exporting to a PNG if you use the Export Bitmap dialog.

  • .pov (POV-Ray). Saves shapes and paths, with color and transparency, as prism objects. Stroke is not saved. To render a drawing, a camera with lights, and so forth, must be defined. See share/inkscape/examples/istest.pov for an example.

    Export test: POV.
    Export test: POV.
  • .ps (PostScript). Inkscape uses a Cairo-based exporter. It is recommended that at least cairo 1.5.2 be used. Note, a pattern that consists of a Group created off the page may not work. Note also that the Print dialog can also be used to produce a PostScript file. PostScript output relies on bitmap fallbacks more than PDF output. This includes any place transparency is used. Finally, the bounding box of the PostScript file will by default be scaled by 80% from the %bbox_nl; of the SVG file. This is the ratio of the PostScript standard 72 points per inch to the 90 pixels per inch default of Inkscape.

    The PostScript dialog offers a variety of options:

    • Restrict to PS level: Either PostScript level 2 or PostScript level 3.

    • Convert texts to paths: Characters in text strings are converted to paths. Fonts are normally subsetted and saved in the file.

    • New in v0.48:

      PS+LaTeX: Omit text in PS, and create LaTeX file: Creates a PostScript file with text excluded and a LaTeX file with text to overlay the PostScript file so that the text font matches that of the LaTeX document and LaTeX math equations in the drawing can be typeset by LaTeX. Supports text alignment and text color (but not transparency). See PDF, PostScript, or EPS with LaTeX Overlay entry in this section.

    • Rasterized filter effects: Converts filter effects to bitmaps. If not enabled, objects with filters are not drawn.

    • Resolution for rasterization: Sets dpi for rasterized filter effects.

    • Export area is drawing: Sets the area for the PostScript file to the area that includes all the drawing elements, even if out of the Page area.

    • Export area is whole page: Export only objects in Page. Sets BoundingBox to page size. This option is useful if exporting only one object.

    • Limit export to object with ID: Limits export to only the object listed. If you want more than one object exported, use a Group.

    Save as PS.
    PostScript output dialog.
    Export test: PS.
    Export test: PS.
  • .sk1 (sK1, fork of Sketch)*. Requires UniConverter 1.1.4. No options available.

  • .tex (LaTeX) Updated for v0.48.

    There are a number of ways to use Inkscape with LaTeX. The first is to export as a LaTeX file with PSTricks macros. The second is to export as a PDF, PostScript, or EPS file with the text moved to a LaTeX overlay; this allows LaTeX to typeset the text. The third is to export as an EPS file and have LaTeX use the psfrag package to replace text labels with text defined inside LaTeX. A fourth is to use the Latex Formula extension that uses LaTeX to typeset an equation and re-import it into Inkscape as a path. And a fifth is to Inkscape to design LaTeX presentations; see Latex Presentation Designer. The first three will be discussed here in turn.

    • LaTeX with PSTricks Macros.  In the method, Inkscape exports the drawing as series of PSTricks macros. This requires that PSTricks package to be installed, which is normally included with LaTeX.

      Here is an example of a LaTeX file to use with Inkscapes tex output saved in the file FileExportTest.tex.

      \documentclass[12pt]{article}
      \usepackage{pstricks}
      \begin{document}
      
      Test of PSTricks with Inkscape.
      
      \input{FileExportTest.tex}
      
      \end{document}
             
      Export test: LaTeX.
      Export test: LaTeX (with PSTricks).
    • PDF, PostScript, or EPS with LaTeX Overlay.  In the method, you insert LaTeX text strings into your drawing. On export to PDF, PostScript, or EPS, check the PDF+LaTeX: Omit text in PDF, and create LaTeX file (or equivalent box for PostScript or EPS); the text will be excluded on export and instead be inserted into a LaTeX file that can be overlayed on the figure inside LaTeX. This has the advantage that the text font matches between the drawing and the rest of the document as well as the ability to typeset LaTeX math equations. This method supports text alignment and text color (transparency is supported in PDF export but not PostScript or EPS as the latter formats do not support transparency). See svg-inkscape on CTAN for more details.

      Here is an example of its use:

      \documentclass[12pt]{article}
      \usepackage{graphicx}
      \usepackage{color}
      \begin{document}
      
      \Huge
      \def\svgwidth{3.333in}
      \input{FileExportText_LaTeX.pdf_tex}
      
      \end{document}
      
             
      Export test: PDF with LaTeX overlay.
      Export test: PDF with LaTeX overlay. The phrase Export Test has been replaced by a LaTeX expression in the Inkscape file.
    • LaTeX with psfrag LaTeX Package.  In the method, you put text tags as placeholders inside of Inkscape. You then export the file to EPS (without converting the text to a path and without manual kerning!). The psfrag package then finds the tags and replaces them with LaTeX expressions.

      Here is an example of a LaTeX file to use with Inkscapes tex output saved in the file FileExportTest.tex.

      As of v0.47, this method will fail as the Cairo-based export uses font subsetting (storing only the characters actually used and then using an index to reference these characters) to save space thus your strings can't be found. A work-around is to search the PostScript file for strings of the form <01020304>Tj or [<010203>-1<0405>-1<06>-1<07>1<08>129<090a06>]TJ and replace them by strings of the form (Export Test)Tj. It is probably better just to use the previous method of saving a PDF, PostScript, or EPS file with a LaTeX overlay.

      Here is an example of its use:

      \documentclass[12pt]{article}
      \usepackage{graphicx}
      \usepackage{psfrag}
      \begin{document}
      
      \Huge
      \psfrag{Export Test}{PSFrag: $\sqrt{x^2+y^2}$}
      \includegraphics{FileExportTest_PlainText.eps}
      
      \end{document}
      
             
      Export test: LaTeX with psfrag.
      Export test: LaTeX using an EPS file with simple text with psfrag. The phrase Export Test has been replaced by a LaTeX expression.
  • .svg, .svgz (SVG, SVG compressed). Several options are available: Plain SVG and SVG with Inkscape extensions (for storage of Inkscape meta data). In theory, any program that reads SVG files should ignore the Inkscape extensions. One additional option is to save an Optimized SVG file. This file has been passed through the Scour script to make the file as small as possible.

  • .wmf (Windows Metafiles)*. Requires UniConverter 1.1.4. No options available.

    Export test: WMF.
    Export test: WMF (As re-imported into Inkscape).
  • Updated for v0.48

    .xaml (Microsoft Application eXtensible Markup Language) Supports gradients and transparency. In v0.47 some objects may end up translated to the wrong place. In addition to fixing translations, v0.48 adds support for blurs and opacity.

    Export test: XAML.
    Export test: XAML (As re-imported into Inkscape).
  • .xcf (Gimp). All top-level layers and objects are exported as separate layers in the PNG format and then inserted as layers into the Gimp native XCF format. Export resolution is fixed at one Inkscape pixel to one Gimp pixel. Requires Python, PyXML, and Gimp 2.2 or higher. Both Gimp and Inkscape must be in the executable path.

    In the export dialog for XCF one can choose whether the Grid and Guide Lines should be saved. If saved, they can be viewed in Gimp by toggling them on under the View Show Grid and View Show Guides menu items. Only rectangular Grids, and vertical and horizontal Guide Lines will be saved.

    Save as XCF.
    XCF output dialog.
    Export test: XCF.
    Export test: XCF.
  • .zip (Compressed Inkscape SVG with Media). This option will save the drawing as an Inkscape SVG file and then package that along with all included (linked) graphics files as a zip package. The resulting file cannot be read directly by Inkscape. However, when the file is uncompressed, all the included graphics should be placed where Inkscape can find them when the SVG file is opened.



[7] The book discloses forward-looking statements on Inkscape features. These forward-looking statements are based on many assumptions including developer availability and customer demand. While the author believes that these forward-looking statements to be reasonable, the reader should not construe these statements to be a contract of any kind.