<chapter label="8" id="loadsave-chapter">
<title>Loading and Saving Diagrams</title>
<sect1 id="loadsave-intro">
 <title>Loading and Saving Introduction</title>
  <para>
   <application>Dia</application> follows the saving model common to most
   desktop applications: you must explicitly save any canvases that you
   wish to retain for future use. To save a file, choose
    <menuchoice>
     <guimenu>File</guimenu>
      <guimenuitem>Save</guimenuitem>
    </menuchoice>
   from the <interface>Main Popup Menu</interface>. The result is a
   standard save dialog. Your canvas is saved in
   <application>Dia</application> XML format. No file extension is
   automatically added, so it is a good idea to explicitly add
  '.dia' to the name you enter.
  </para>
  <para>
   To load a canvas from a file previously saved by
   <application>Dia</application> or created by another application,
   select
    <menuchoice>
     <guimenu>File</guimenu>
     <guimenuitem>Open...</guimenuitem>
    </menuchoice>
   from the <interface>Main Menu Bar</interface>. The result is an
   <interface>open dialog</interface>; select the file you want
   and choose <guibutton>Open</guibutton>. The <interface>open
   dialog</interface> is standard apart from the popup menu labeled
   <guimenu>Determine file type</guimenu>. Choose the format of the file
   to open (<application>Dia</application> XML or Drawing Interchange)
   if <application>Dia</application> does not correctly determine the
   file format unassisted.
  </para>
  <para>An alternate file-loading method is to start
  <application>Dia</application> from the command line with the name
   of the file to open given as an argument.
  </para>
 </sect1>
   <sect1 id="loadsave-filetypes">
   <title>File Types</title>
    <para>
     A few words on file types are in order. You should be aware that not all
     format of files can be re-loaded into <application>Dia</application>
     after saving and that most supported file formats lose information to
     some degree.
    </para>
    <sect2 id="loadsave-filetypes-dia">
    <title>Dia Native Diagram Files</title>
     <para>
      The only format guaranteed to be lossless is
      <application>Dia</application> XML. Happily, you are unlikely to
      accidentally save in a lossy format because
       <menuchoice>
        <guimenu>File</guimenu>
         <guimenuitem>Save</guimenuitem>
       </menuchoice>
      always produces a file in <application>Dia</application> XML format.
     </para>
     <para>
      Files in <application>Dia</application> XML format are automatically
      compressed using gzip to save disk space. This is almost necessary
      since, without compression, even simple diagrams are very large because
      they store much redundant information. 
      <application>Dia</application> XML files are already compressed, 
      so further compressing them using other archive formats will not help
      make them significantly smaller.  
     </para>
    </sect2>
    <sect2 id="loadsave-filetypes-import">
    <title>Import/Export Formats</title>
     <para>
      <application>Dia</application> is able to import and export the following file types:
      <itemizedlist>
       <listitem>
        <para>
	 Scalable Vector Graphics (.svg)
	</para>
       </listitem>
       <listitem>
        <para>
	 AutoCad Drawing eXchange Format (.dxf)
	</para>
       </listitem>
       <listitem>
        <para>
	 Visio XML File Format (.vdx)
	</para>
       </listitem>
       <listitem>
        <para>
	 XFig File Format (.fig)
	</para>
       </listitem>
       <listitem>
        <para>
          GdkPixbuf bitmap graphics (.bmp, .gif, .jpg, .png, .pnm, .ras, .tif)
        </para>
       </listitem>
      </itemizedlist> 
     </para>
    </sect2>
<!-- Add loadsave-filestypes-dif section in future -->
    <sect2 id="loadsave-filetypes-export">
    <title>Exporting Only Formats</title>
     <para>
     <application>Dia</application> supports exporting to many other types of
     file, such as:
     <itemizedlist>
      <listitem>
       <para>
         Computer Graphics Metafile (.cgm)
       </para>
      </listitem>
      <listitem>
       <para>
        Dia Shape File (.shape)
       </para>
      </listitem>
      <listitem>
       <para>
        HP Graphics Language (.plt, .hpgl) 
       </para>
      </listitem>
      <listitem>
       <para>
        Encapsulated Postscript (.eps, .epsi)
       </para>
      </listitem>
      <listitem>
       <para>
        Postscript (.ps)
       </para>
      </listitem>
      <listitem>
       <para>
        Portable Document Format (.pdf)
       </para>
      </listitem>
      <listitem>
       <para>
        Portable Network Graphics (.png)
       </para>
      </listitem>
      <listitem>
       <para>
        TeX Metapost macros (.mp)
       </para>
      </listitem>
      <listitem>
       <para>
        TeX PSTricks macros (.tex)
       </para>
      </listitem>	
      <listitem>
       <para>
        WordPerfect Graphics (.wpg)
       </para>
      </listitem>
      <listitem>
       <para>
        XFig format (.fig)
       </para>
      </listitem> 
      <listitem>
       <para>
        XSLT (eXtensible Stylesheet Language Transformation) (.code)
       </para>
      </listitem>
     </itemizedlist>
     <application>Dia</application> cannot load files in most of these formats.  These
     formats are useful for diagrams that you need to use in another
     application or to distribute to users of another operating system that
     <application>Dia</application> does not support.
     <!--Lets go through later and make this a variablelist, as well as describe
     the strengths of each of these formats  -->
<!--      Computer Graphics Metafile, HPGL, EPS, PNG, SVG,
      TeX, and WPG formats are supported for crating files
      only&mdash;<application>Dia</application> cannot load files in these
      formats. These formats are useful for diagrams that you need to use
      in another application (e.g., the World-wide Web) or distribute to
      users of an operating system that <application>Dia</application>
      does not support.
-->
     </para>
     <para>
      To create a file in one of these formats, select
       <menuchoice>                                                                             
	 <guimenu>File</guimenu>
         <guimenuitem>Export...</guimenuitem>
       </menuchoice>
      from the <interface>Main Popup Menu</interface>. Choose a name
      and the desired format in the resulting dialog, which works like a
      <interface>save</interface> dialog. An appropriate file extension
      is automatically added.
     </para>
   </sect2>
  </sect1>
</chapter> 
