<?xml version="1.0"?>
<Media version="1.0">

  <!-- Physical paper sizes -->
  <!-- Custom size is special-case-defined by library -->

  <PhysicalSizes Default="A4">

    <!-- US and other nonstandard sizes -->

    <PhysicalSize Id="USLetter" Width="612" Height="792">
      <Name>US Letter</Name>
    </PhysicalSize>
    <PhysicalSize Id="USLegal" Width="612" Height="1008">
      <Name>US Legal</Name>
    </PhysicalSize>
    <PhysicalSize Id="Executive" Width="522" Height="756">
      <Name>Executive</Name>
    </PhysicalSize>

    <!-- ISO A Series -->

    <PhysicalSize Id="A0" Width="841mm" Height="1189mm">
      <Name>A0</Name>
    </PhysicalSize>
    <PhysicalSize Id="A1" Width="594mm" Height="841mm">
      <Name>A1</Name>
    </PhysicalSize>
    <PhysicalSize Id="A2" Width="420mm" Height="594mm">
      <Name>A2</Name>
    </PhysicalSize>
    <PhysicalSize Id="A3" Width="297mm" Height="420mm">
      <Name>A3</Name>
    </PhysicalSize>
    <PhysicalSize Id="A4" Width="210mm" Height="297mm">
      <Name>A4</Name>
    </PhysicalSize>
    <PhysicalSize Id="A5" Width="148mm" Height="210mm">
      <Name>A5</Name>
    </PhysicalSize>
    <PhysicalSize Id="A6" Width="105mm" Height="148mm">
      <Name>A6</Name>
    </PhysicalSize>
    <PhysicalSize Id="A7" Width="74mm" Height="105mm">
      <Name>A7</Name>
    </PhysicalSize>
    <PhysicalSize Id="A8" Width="52mm" Height="74mm">
      <Name>A8</Name>
    </PhysicalSize>
    <PhysicalSize Id="A9" Width="37mm" Height="52mm">
      <Name>A9</Name>
    </PhysicalSize>
    <PhysicalSize Id="A10" Width="26mm" Height="37mm">
      <Name>A10</Name>
    </PhysicalSize>

    <!-- ISO B Series -->

    <PhysicalSize Id="B0" Width="1000mm" Height="1414mm">
      <Name>B0</Name>
    </PhysicalSize>
    <PhysicalSize Id="B1" Width="707mm" Height="1000mm">
      <Name>B1</Name>
    </PhysicalSize>
    <PhysicalSize Id="B2" Width="500mm" Height="707mm">
      <Name>B2</Name>
    </PhysicalSize>
    <PhysicalSize Id="B3" Width="353mm" Height="500mm">
      <Name>B3</Name>
    </PhysicalSize>
    <PhysicalSize Id="B4" Width="250mm" Height="353mm">
      <Name>B4</Name>
    </PhysicalSize>
    <PhysicalSize Id="B5" Width="176mm" Height="250mm">
      <Name>B5</Name>
    </PhysicalSize>
    <PhysicalSize Id="B6" Width="125mm" Height="176mm">
      <Name>B6</Name>
    </PhysicalSize>
    <PhysicalSize Id="B7" Width="88mm" Height="125mm">
      <Name>B7</Name>
    </PhysicalSize>
    <PhysicalSize Id="B8" Width="62mm" Height="88mm">
      <Name>B8</Name>
    </PhysicalSize>
    <PhysicalSize Id="B9" Width="44mm" Height="62mm">
      <Name>B9</Name>
    </PhysicalSize>
    <PhysicalSize Id="B10" Width="31mm" Height="44mm">
      <Name>B10</Name>
    </PhysicalSize>

    <!-- ISO C Series -->

    <PhysicalSize Id="C0" Width="917mm" Height="1297mm">
      <Name>C0</Name>
    </PhysicalSize>
    <PhysicalSize Id="C1" Width="648mm" Height="917mm">
      <Name>C1</Name>
    </PhysicalSize>
    <PhysicalSize Id="C2" Width="458mm" Height="648mm">
      <Name>C2</Name>
    </PhysicalSize>
    <PhysicalSize Id="C3" Width="324mm" Height="458mm">
      <Name>C3</Name>
    </PhysicalSize>
    <PhysicalSize Id="C4" Width="229mm" Height="324mm">
      <Name>C4</Name>
    </PhysicalSize>
    <PhysicalSize Id="C5" Width="162mm" Height="229mm">
      <Name>C5</Name>
    </PhysicalSize>
    <PhysicalSize Id="C6" Width="114mm" Height="162mm">
      <Name>C6</Name>
    </PhysicalSize>
    <PhysicalSize Id="C7" Width="81mm" Height="114mm">
      <Name>C7</Name>
    </PhysicalSize>
    <PhysicalSize Id="C8" Width="57mm" Height="81mm">
      <Name>C8</Name>
    </PhysicalSize>
    <PhysicalSize Id="C9" Width="40mm" Height="57mm">
      <Name>C9</Name>
    </PhysicalSize>
    <PhysicalSize Id="C10" Width="28mm" Height="40mm">
      <Name>C10</Name>
    </PhysicalSize>

    <!-- ISO Tickets -->

    <PhysicalSize Id="A4_3" Width="99mm" Height="210mm">
      <Name>1/3 A4</Name>
    </PhysicalSize>
    <PhysicalSize Id="A4_4" Width="74mm" Height="210mm">
      <Name>1/4 A4</Name>
    </PhysicalSize>
    <PhysicalSize Id="A4_8" Width="37mm" Height="210mm">
      <Name>1/8 A4</Name>
    </PhysicalSize>
    <PhysicalSize Id="A3_4" Width="105mm" Height="297mm">
      <Name>1/4 A3</Name>
    </PhysicalSize>
    <PhysicalSize Id="A5_3" Width="70mm" Height="148mm">
      <Name>1/3 A5</Name>
    </PhysicalSize>

    <!-- ISO Special Envelopes -->

    <PhysicalSize Id="DL" Width="110mm" Height="220mm">
      <Name>DL Envelope</Name>
    </PhysicalSize>
    <PhysicalSize Id="C6_C5" Width="114mm" Height="229mm">
      <Name>C6/C5 Envelope</Name>
    </PhysicalSize>


    <PhysicalSize Id="Envelope_No10" Width="297" Height="684">
      <Name>Envelope No10</Name>
    </PhysicalSize>
    <PhysicalSize Id="Envelope_6x9" Width="432" Height="648">
      <Name>Envelope No10</Name>
    </PhysicalSize>
    <!-- See http://www.twics.com/~eds/paper/env.html or
	     http://mydesignprimer.com/printing/50024.html
	 for more envelope sizes.
     -->

  </PhysicalSizes>

  <!-- Physical orientations -->
  <!-- Do not modify these, as they can well be defined in library -->
  <!-- We need all 4 defined here for asymmetrical pages, like envelopes -->
  <!-- Width and Height are that of physical paper, not print image area -->

  <PhysicalOrientations>
    <PhysicalOrientation Id="R0" Paper2PrinterTransform="matrix(1 0 0 1 0 0)">
      <Name>Straight</Name>
    </PhysicalOrientation>
    <PhysicalOrientation Id="R90" Paper2PrinterTransform="matrix(0 -1 1 0 0 100%)">
      <Name>Rotated 90 degrees</Name>
    </PhysicalOrientation>
    <PhysicalOrientation Id="R180" Paper2PrinterTransform="matrix(-1 0 0 -1 100% 100%)">
      <Name>Rotated 180 degrees</Name>
    </PhysicalOrientation>
    <PhysicalOrientation Id="R270" Paper2PrinterTransform="matrix(0 1 -1 0 100% 0)">
      <Name>Rotated 270 degrees</Name>
    </PhysicalOrientation>
  </PhysicalOrientations>

  <!-- Logical orientations -->
  <!-- Do not modify these, as they can well be defined in library -->
  <!-- This is how you want your page to be oriented relative to layout logical page -->
  <!-- This will be multiplied by layout before applying -->
  <!-- We need all 4 defined here for asymmetrical pages, like envelopes -->
  <!-- Width and Height are those of layout page -->

  <LogicalOrientations>
    <LogicalOrientation Id="R0" Page2LayoutTransform="matrix(1 0 0 1 0 0)">
      <Name>Portrait</Name>
    </LogicalOrientation>
    <LogicalOrientation Id="R90" Page2LayoutTransform="matrix(0 1 -1 0 0 100%)">
      <Name>Landscape</Name>
    </LogicalOrientation>
    <LogicalOrientation Id="R180" Page2LayoutTransform="matrix(-1 0 0 -1 100% 100%)">
      <Name>Upside down portrait</Name>
    </LogicalOrientation>
    <LogicalOrientation Id="R270" Page2LayoutTransform="matrix(0 -1 1 0 100% 0)">
      <Name>Upside down landscape</Name>
    </LogicalOrientation>
  </LogicalOrientations>

  <!-- Layouts -->
  <!-- Plain layout is special-case-defined by library -->
  <!-- Width and Height are those of physical page -->

  <Layouts>

    <!-- Standard Layouts -->

    <!-- 2 logical pages zoomed out to single physical page -->
    <Layout Id="2_1" ValidPhysicalSizes="All" LogicalPages="2" PhysicalPages="1" Width="0.5" Height="1">
      <Name>2 pages to 1</Name>
      <Page transform="matrix(0 -SQRT1_2 SQRT1_2 0 0 1)"/>
      <Page transform="matrix(0 -SQRT1_2 SQRT1_2 0 0 0.5)"/>
    </Layout>

    <!-- 4 logical pages zoomed out to single physical page -->
    <Layout Id="4_1" ValidPhysicalSizes="All" LogicalPages="4" PhysicalPages="1" Width="0.5" Height="0.5">
      <Name>4 pages to 1</Name>
      <Page transform="matrix(0.5 0 0 0.5 0 0.5)"/>
      <Page transform="matrix(0.5 0 0 0.5 0.5 0.5)"/>
      <Page transform="matrix(0.5 0 0 0.5 0 0)"/>
      <Page transform="matrix(0.5 0 0 0.5 0.5 0)"/>
    </Layout>

    <!-- 1 Physical page divided into 2 logical pages -->
    <Layout Id="I2_1" ValidPhysicalSizes="All" LogicalPages="2" PhysicalPages="1" Width="0.5" Height="1">
      <Name>Divided</Name>
      <Page transform="matrix(0 -1 1 0 0 1)"/>
      <Page transform="matrix(0 -1 1 0 0 0.5)"/>
    </Layout>

    <!-- 1 Physical page divided into 2 opposite logical pages -->
    <Layout Id="IM2_1" ValidPhysicalSizes="All" LogicalPages="2" PhysicalPages="1" Width="0.5" Height="1">
      <Name>Folded</Name>
      <Page transform="matrix(0 -1 1 0 0 0.5)"/>
      <Page transform="matrix(0 1 -1 0 1 0.5)"/>
    </Layout>

  </Layouts>

</Media>
