## 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.

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 in the Document Properties dialog. This is useful for setting the page size after creating an illustration.

### Exporting PNG (Portable Network Graphic) Files

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

Note This dialog ONLY exports PNG files, regardless of what file extension you use.
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. Only the Width and width dpi can be changed; the Height will scale to preserve 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.
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 “export” Layer. 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 → Select All (Ctrl+A) to select all the rectangles in the Layer, then do a batch export. Four slices created using batch export.
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.
Rendering Errors Inkscape 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. Firefox, Opera, and Batik do not have this problem. Batik can be used to produce a high-quality PNG, JPEG, or TIFF file.

New in v0.47:

Inkscape now 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 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.

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.
In Case of Failure If exporting fails to work, check the file extension-errors.log located on Linux at ~/.inkscape/ (v0.46) or ~/.config/inkscape/ (v0.47) 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):

• Removed in v0.47.

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

• Updated in v0.47.

.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. The options available are the same as for PostScript output.

• 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. There is one option that targets Craft ROBO Desktop plotters that require an even simpler file format.

The packages python-lxml and numpy are required.

DXF output dialog for Desktop Cutting Plotter routine.

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.

• Updated in v0.47.

.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 concerns 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.

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.
• New in v0.47.

.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.
• .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.

• New in v0.47.

.hpgl (Hewlett-Packard Graphics Language). See also .plt format below. 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.

HPGL output dialog.
Export test: HPGL.
• .odg (Open Document Graphic). Limited support, better support planned.[8] 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.The text was initially invisible.
• Updated for v0.47.

.pdf (PDF). Inkscape uses a Cairo-based exporter. It is recommended that at least cairo 1.5.2 be used. Patterns, clipping, and masking are supported as of v0.47. 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.

Evince and Acroread Older versions of Evince, a popular Linux PostScript and PDF viewer, do not show gradients with transparency properly. All versions have problems with Patterns. 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:

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

• 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.

PDF output dialog.
Export test: PDF.
• New in v0.47.

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

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 declaration on the first line, while a PLT file will be a solid mass of letters and numbers without spaces.
Export test: PLT (HPGL).
• .png (PNG via Cairo) Saves file as a PNG via Cairo. Better export is performed using the File Export Bitmap... (Shift+Ctrl+E) command. This routine is mainly for testing Cairo-based export.

• .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.
• Updated for v0.47.

.ps (PostScript). Inkscape uses a Cairo-based exporter. It is recommended that at least cairo 1.5.2 be used. Patterns, clipping, and masking are supported as of v0.47. 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 as of v0.47.

• 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.

PostScript output dialog.
Export test: PS.
• New in v0.47.

.sk1 (sK1, fork of Sketch)*. Requires UniConverter 1.1.4. No options available.

• .tex (LaTeX with PSTricks macros). Requires the PSTricks package to be installed, which is normally included with the LaTeX package.

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

\documentclass[12pt]{article}
\usepackage{pstricks}
\begin{document}

Test of PSTricks with Inkscape.

\input{FileExportTest.tex}

\end{document}

Export test: LaTeX.
Equations in Figures If you need equations in your figures, there are two methods available. The first is to use the Latex Formula extension. Alternatively, you can use the psfrag LaTeX package. To use the latter, put a place holder for your equation in a text box. Then export as an EPS file (without converting the text to a path or using manual kerning!). The psfrag package can then be used to replace the placeholder with a latex expression. Putting text on a diagonal is possible. 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.  \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 using an EPS file with simple text with psfrag. The phrase “Export Test” has been replaced by a LaTeX expression.

Inkscape can also be used to design LaTeX presentation styles. See Latex Presentation Designer.

• .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. New in v0.47: 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.

• New in v0.47.

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

Export test: WMF (As reimported into Inkscape).
• .xaml (Microsoft Application eXtensible Markup Language) Supports gradients and transparency. Some objects may end up translated to the wrong place.

Export test: XAML (As reimported 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.

New in v0.47:

In the export dialog for XCF one can choose if 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.

XCF output dialog.
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.

[8] 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.