Chapter 2. Files

Table of Contents

This section covers the manipulation of the files that are used by Inkscape. This includes the files for storing your drawings in the Inkscape format, and for importing and exporting drawings in other formats. All the commands to manipulate files can be found under the File menu. Several of the commands can also be found in the Command Bar (New, Open, Save, Print, Import, and Export Bitmap).

Inkscape drawings are stored in SVG files. While SVG files are scalable, they have a nominal size defined by the SVG "width" and "height" attributes. The width and height may be defined with units such as centimeters and inches, or without units, in which case the numbers are interpreted as pixels.

The internal scale is defined by the viewBox attribute which sets the length of the initial SVG user unit. For example, one can use the viewBox to set the internal scale such that a length of one is equivalent to a millimeter when the drawing is rendered with the nominal width and height. If the viewBox attribute is missing then the internal scale is set so that the initial user unit is equal to a pixel.

The nominal drawing size and internal scale can be changed by going to the Page tab of the Document Properties dialog. See the the section called “Document Dimensions and Scale” section at the end of this chapter.

[Warning]Do not use absolute units with lengths inside SVG files

Except when setting the nominal width and height of an SVG file, do not use absolute units (inches, millimeters, etc.) with lengths! In the early days of SVG, it was envisioned that setting the width of a rectangle to one inch ('1in') should produce a one inch wide rectangle on a CRT screen, a printer, or any other rendering device. This turned out to be impracticable for a variety of reasons. Eventually, the CSS standards group defined that one inch is equal to 96 pixels which in the case of SVG is equivalent to 96 user units (without any scaling transforms applied). Inkscape until v0.92 used a scale of 90 pixels per inch which lead to inconsistent rendering between Inkscape and web browsers when lengths with absolute units were used. Inkscape v0.92 uses the correct 96 pixels per inch value. Recent versions of Inkscape do not save lengths with absolute units but will instead convert them to user units even when the GUI shows lengths with units. The normal user should never have to worry about this.

[Note]Sizing an SVG for the Web

If you plan on using an SVG in a Web page, see the section called “Positioning SVG”.