<chapter id="itext">
    <title>iText PDF generation</title>
    <para>Seam now includes a component set for generating documents using iText. The primary focus of Seam's iText
        document support is for the generation of PDF doucuments, but Seam also offers basic support for RTF document
        generation.</para>

    <section id="itext.intro">
        <title>Using PDF Support</title>
        <para>iText support is provided by <literal>jboss-seam-pdf.jar</literal>. This JAR contains the iText JSF
            controls, which are used to construct views that can render to PDF, and the DocumentStore component, which
            serves the rendered documents to the user. To include PDF support in your application, included
                <literal>jboss-seam-pdf.jar</literal> in your <literal>WEB-INF/lib</literal> directory along with the
            iText JAR file. There is no further configuration needed to use Seam's ciText supportfon. </para>
        <para> The Seam iText module requires the use of Facelets as the view technology. Future versions of the library
            may also support the use of JSP. Additionally, it requires the use of the seam-ui package.</para>

        <para> The <literal>examples/itext</literal> project contains an example of the PDF support in action. It
            demonstrates proper deployment packaging, and it contains a number examples that demonstrate the key PDF
            generation features current supported. </para>

        <section id="itext.document">
            <title>Creating a document</title>

            <informaltable>
                <tgroup cols="2">
			<!--        <colspec colnum="1" colwidth="1*"/> -->
			<!--      <colspec colnum="2" colwidth="3*"/> -->

                    <tbody>

                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:document&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>
                                <para> Documents are generated by facelet XHTML files using tags in the
                                        <literal>http://jboss.com/products/seam/pdf</literal> namespace. Documents
                                    should always have the <literal>document</literal> tag at the root of the document.
                                    The <literal>document</literal> tag prepares Seam to generate a document into the
                                    DocumentStore and renders an HTML redirect to that stored content.</para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>

                                <itemizedlist>
                                    <listitem>
                                        <para>
                                            <literal>type</literal> &#8212; The type of the document to be produced.
                                            Valid values are <literal>PDF</literal>, <literal>RTF</literal> and
                                                <literal>HTML</literal> modes. Seam defaults to PDF generation, and many
                                            of the features only work correctly when generating PDF documents.</para>
                                    </listitem>


                                    <listitem>
                                        <para>
                                            <literal>pageSize</literal> &#8212; The size of the page to be generate.
                                            The most commonly used values would be <literal>LETTER</literal> and
                                                <literal>A4</literal>. A full list of supported pages sizes can be found
                                            in <literal>com.lowagie.text.PageSize</literal> class. Alternatively,
                                            pageSize can provide the width and height of the page directly. The value
                                            "612 792", for example, is equivalent to the LETTER page size. </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>orientation</literal> &#8212; The orientation of the page.
                                            Valid values are <literal>portrait</literal> and
                                            <literal>landscape</literal>. In landscape mode, the height and width page
                                            size values are reversed. </para>
                                    </listitem>


                                    <listitem>
                                        <para>
                                            <literal>margins</literal> &#8212; The left, right, top and bottom
                                            margin values. </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>marginMirroring</literal> &#8212; Indicates that margin
                                            settings should be reversed an alternating pages.</para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>disposition</literal> &#8212; When generating PDFs in a web browser, this determines the HTTP
                                            <literal>Content-Disposition</literal> of the document.  Valid values are <literal>inline</literal>, which
                                            indicates the document should be displayed in the browser window if possible,
                                            and <literal>attachment</literal>, which indicates that the document should be treated as a download. 
                                            The default value is <literal>inline</literal>.</para>
                                    </listitem>
                                </itemizedlist>


                                <para>
                                    <emphasis>Metadata Attributes</emphasis>
                                </para>


                                <itemizedlist>
                                    <listitem>
                                        <para>
                                            <literal>title</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>subject</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>keywords</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>author</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>creator</literal>
                                        </para>
                                    </listitem>
                                </itemizedlist>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML"><![CDATA[<p:document xmlns:p="http://jboss.com/products/seam/pdf">                                                      
  The document goes here.                                                                                             
</p:document>]]></programlisting>


                            </entry>
                        </row>
                    </tbody>
                </tgroup>
            </informaltable>

        </section>


        <section id="itext.text">
            <title>Basic Text Elements</title>

            <para> Useful documents will need to contain more than just text; however, the standard UI components are
                geared towards HTML generation and are not useful for generating PDF content. Instead, Seam provides a
                special UI components for generating suitable PDF content. Tags like
                <literal>&lt;p:image&gt;</literal> and <literal>&lt;p:paragraph&gt;</literal> are the
                basic foundations of simple documents. Tags like <literal>&lt;p:font&gt;</literal> provide style
                information to all the content surrounging them. </para>


            <informaltable>
                <tgroup cols="2">
			<!--        <colspec colnum="1" colwidth="1*"/> -->
			<!--      <colspec colnum="2" colwidth="3*"/> -->

                    <tbody>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:paragraph&gt;</literal>
                                </para>
                            </entry>


                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>
                                <para> Most uses of text should be sectioned into paragraphs so that text fragments can
                                    be flowed, formatted and styled in logical groups.</para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>

                                <itemizedlist>
                                    <listitem>
                                        <para>
                                            <literal>firstLineIndent</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>extraParagraphSpace</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>leading</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>multipliedLeading</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>spacingBefore</literal> &#8212; The blank space to be inserted
                                            before the element. </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>spacingAfter</literal> &#8212; The blank space to be inserted
                                            after the element.</para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>indentationLeft</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>indentationRight</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>keepTogether</literal>
                                        </para>
                                    </listitem>
                                </itemizedlist>

                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML"><![CDATA[<p:paragraph alignment="justify">
    This is a simple document.  It isn't very fancy.
</p:paragraph>]]></programlisting>

                            </entry>
                        </row>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:text&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>

                                <para> The <literal>text</literal> tag allows text fragments to be produced from
                                    application data using normal JSF converter mechanisms. It is very similar to the
                                        <literal>outputText</literal> tag used when rendering HTML documents. </para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>


                                <itemizedlist>
                                    <listitem>
                                        <para><literal>value</literal> &#8212; The value to be displayed. This will
                                            typically be a value binding expression.</para>
                                    </listitem>
                                </itemizedlist>

                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>

                                <programlisting role="XHTML"><![CDATA[<p:paragraph>
    The item costs <p:text value="#{product.price}">
        <f:convertNumber type="currency" currencySymbol="$"/>
    </p:text>
</p:paragraph>]]></programlisting>

                            </entry>
                        </row>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:html&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>

                                <para> The <literal>html</literal> tag renders HTML content into the PDF.                                                                      
                                </para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>


                                <itemizedlist>
                                    <listitem>
                                        <para><literal>value</literal> &#8212; The text to be displayed.</para>
                                    </listitem>
                                </itemizedlist>

                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>

                                <programlisting role="XHTML"><![CDATA[
<p:html value="This is HTML with <b>some markup</b>." />
<p:html>
    <h1>This is more complex HTML</h1>
    <ul>
        <li>one</li>
        <li>two</li>
        <li>three</li>
    </ul>
</p:html>

<p:html>
    <s:formattedText value="*This* is |Seam Text| as HTML.  It's very^cool^." />
</p:html>                                    
]]></programlisting>

                            </entry>
                        </row>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:font&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>

                                <para> The font tag defines the default font to be used for all text inside of it. </para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>


                                <itemizedlist>
                                    <listitem>
                                        <para><literal>name</literal> &#8212; The font name, for example:
                                                <literal>COURIER</literal>, <literal>HELVETICA</literal>,
                                                <literal>TIMES-ROMAN</literal>, <literal>SYMBOL</literal> or
                                                <literal>ZAPFDINGBATS</literal>.</para>
                                    </listitem>

                                    <listitem>
                                        <para><literal>size</literal> &#8212; The point size of the font.</para>
                                    </listitem>

                                    <listitem>
                                        <para><literal>style</literal> &#8212; The font styles. Any combination of :
                                                <literal>NORMAL</literal>, <literal>BOLD</literal>,
                                            <literal>ITALIC</literal>, <literal>OBLIQUE</literal>,
                                            <literal>UNDERLINE</literal>, <literal>LINE-THROUGH</literal></para>

                                    </listitem>

                                    <listitem>
                                        <para><literal>encoding</literal> &#8212; The character set encoding.</para>
                                    </listitem>
                                </itemizedlist>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>

                                <programlisting role="XHTML"><![CDATA[<p:font name="courier" style="bold" size="24">
    <p:paragraph>My Title</p:paragraph>
</p:font>]]></programlisting>

                            </entry>
                        </row>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:newPage&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>


                                <para><literal>p:newPage</literal> inserts a page break. </para>


                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>

                                <programlisting role="XHTML"><![CDATA[<p:newPage />]]></programlisting>

                            </entry>
                        </row>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:image&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>


                                <para><literal>p:image</literal> inserts an image into the document. Images can be be
                                    loaded from the classpath or from the web application context using the
                                        <literal>value</literal> attribute. </para>



                                <para>Resources can also be dynamically generated by application code. The
                                        <literal>imageData</literal> attribute can specify a value binding expression
                                    whose value is a <literal>java.awt.Image</literal> object. </para>




                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>

                                <itemizedlist>
                                    <listitem>
                                        <para><literal>value</literal> &#8212; A resource name or a method
                                            expression binding to an application-generated image. </para>
                                    </listitem>


                                    <listitem>
                                        <para><literal>rotation</literal> &#8212; The rotation of the image in
                                            degrees. </para>
                                    </listitem>


                                    <listitem>
                                        <para><literal>height</literal> &#8212; The height of the image. </para>
                                    </listitem>

                                    <listitem>
                                        <para><literal>width</literal> &#8212; The width of the image. </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>alignment</literal>&#8212; The alignment of the image. (see
                                                <xref linkend="itext.alignment"/> for possible values) </para>

                                    </listitem>
                                    <listitem>

                                        <para>
                                            <literal>alt</literal> &#8212; Alternative text representation for the
                                            image.</para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>indentationLeft</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>indentationRight</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>spacingBefore</literal> &#8212; The blank space to be inserted
                                            before the element.</para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>spacingAfter</literal> &#8212; The blank space to be inserted
                                            after the element.</para>

                                    </listitem>
                                    <listitem>

                                        <para>
                                            <literal>widthPercentage</literal>
                                        </para>

                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>initialRotation</literal>
                                        </para>
                                    </listitem>
                                    <listitem>

                                        <para>
                                            <literal>dpi</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>scalePercent</literal> &#8212; The scaling factor (as a
                                            percentage) to use for the image. This can be expressed as a single
                                            percentage value or as two percentage values representing separate x and y
                                            scaling percentages.</para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>wrap</literal>
                                        </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>underlying</literal>
                                        </para>
                                    </listitem>
                                </itemizedlist>

                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>


                                <programlisting role="XHTML"><![CDATA[<p:image value="/jboss.jpg" />]]></programlisting>
                                <programlisting role="XHTML"><![CDATA[<p:image value="#{images.chart}" />]]></programlisting>


                            </entry>
                        </row>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:anchor&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>
                                <para><literal>p:anchor</literal> defines clickable links from a document. It supports
                                    the following attributes:</para>


                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>


                                <itemizedlist>
                                    <listitem>
                                        <para><literal>name</literal> &#8212; The name of an in-document anchor
                                            destination.</para>

                                    </listitem>

                                    <listitem>

                                        <para><literal>reference</literal> &#8212; The destination the link refers
                                            to. Links to other points in the document should begin with a "#". For
                                            example, "#link1" to refer to an anchor postion with a
                                            <literal>name</literal> of <literal>link1</literal>. Links may also be a
                                            full URL to point to a resource outside of the document.</para>
                                    </listitem>
                                </itemizedlist>


                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML"><![CDATA[<p:listItem><p:anchor reference="#reason1">Reason 1</p:anchor></p:listItem> 
...
<p:paragraph>
    <p:anchor name="reason1">It's the quickest way to get "rich"</p:anchor> 
    ... 
</p:paragraph>]]></programlisting>

                            </entry>
                        </row>
                    </tbody>
                </tgroup>
            </informaltable>

        </section>

        <section id="itext.header">
            <title>Headers and Footers</title>



            <informaltable>
                <tgroup cols="2">
			<!--         <colspec colnum="1" colwidth="1*"/> -->
			<!--       <colspec colnum="2" colwidth="3*"/> -->

                    <tbody>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:header&gt;</literal>
                                </para>
                                <para>
                                    <literal>&lt;p:footer&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>
                                <para>The <literal>p:header</literal> and <literal>p:footer</literal> components provide
                                    the ability to place header and footer text on each page of a generated document,
                                    with the exception of the first page. Header and footer declarations should appear
                                    near the top of a document. </para>


                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>


                                <itemizedlist>


                                    <listitem>
                                        <para>
                                            <literal>alignment</literal> &#8212; The alignment of the header/footer
                                            box section. (see <xref linkend="itext.alignment"/> for alignment values)</para>

                                    </listitem>

                                    <listitem>
                                        <para><literal>backgroundColor</literal> &#8212; The background color of the
                                            header/footer box. (see <xref linkend="itext.colors"/> for color values)
                                        </para>
                                    </listitem>




                                    <listitem>
                                        <para><literal>borderColor</literal> &#8212; The border color of the
                                            header/footer box. Individual border sides can be set using
                                                <literal>borderColorLeft</literal>, <literal>borderColorRight</literal>,
                                                <literal>borderColorTop</literal> and
                                            <literal>borderColorBottom</literal>.(see <xref linkend="itext.colors"/> for
                                            color values) </para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>borderWidth</literal> &#8212; The width of the border.
                                            Inidvidual border sides can be specified using
                                            <literal>borderWidthLeft</literal>, <literal>borderWidthRight</literal>,
                                                <literal>borderWidthTop</literal> and
                                            <literal>borderWidthBottom</literal>.</para>
                                    </listitem>
                                </itemizedlist>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML"><![CDATA[<p:facet name="header">
  <p:font size="12">
    <p:footer borderWidthTop="1" borderColorTop="blue" 
              borderWidthBottom="0" alignment="center">
        Why Seam? [<p:pageNumber />]
    </p:footer>
  </p:font>
</f:facet>]]></programlisting>

                            </entry>
                        </row>
                        <row>
                            <entry valign="top">
                                <para>
                                    <literal>&lt;p:pageNumber&gt;</literal>
                                </para>
                            </entry>
                            <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>
                                <para>The current page number can be placed inside of a header or footer using the
                                        <literal>p:pageNumber</literal> tag. The page number tag can only be used in the
                                    context of a header or footer and can only be used once.</para>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML">&lt;p:footer borderWidthTop=&quot;1&quot; borderColorTop=&quot;blue&quot; 
          borderWidthBottom=&quot;0&quot; alignment=&quot;center&quot;&gt;
    Why Seam? [&lt;p:pageNumber /&gt;]
&lt;/p:footer&gt;</programlisting>

                            </entry>
                        </row>
                    </tbody>
                </tgroup>
            </informaltable>
        </section>




        <section id="itext.chapters">
            <title>Chapters and Sections</title>

            <informaltable>
                <tgroup cols="2">
			<!--    <colspec colnum="1" colwidth="1*"/> -->
			<!--      <colspec colnum="2" colwidth="3*"/> -->

                    <tbody>
                        <row>
				          <entry valign="top"> 
                                <para>
                                    <literal>&lt;p:chapter&gt;</literal>
                                </para>
                                <para>
                                    <literal>&lt;p:section&gt;</literal>
                                </para>
                            </entry>
			        <entry valign="top"> 
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>

                                <para>If the generated document follows a book/article structure, the
                                    <literal>p:chapter</literal> and <literal>p:section</literal> tags can be used to
                                    provide the necessary structure. Sections can only be used inside of chapters, but
                                    they may be nested arbitrarily deep. Most PDF viewers provide easy navigation
                                    between chapters and sections in a document. </para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>


                                <itemizedlist>


                                    <listitem>
                                        <para>
                                            <literal>alignment</literal> &#8212; The alignment of the header/footer
                                            box section. (see <xref linkend="itext.alignment"/> for alignment values)</para>

                                    </listitem>

                                    <listitem>
                                        <para><literal>number</literal> &#8212; The chapter number. Every chapter
                                            should be assigned a chapter number.</para>
                                    </listitem>

                                    <listitem>
                                        <para><literal>numberDepth</literal> &#8212; The depth of numbering for
                                            section. All sections are numbered relative to their surrounding
                                            chapter/sections. The fourth section of of the first section of chapter
                                            three would be section 3.1.4, if displayed at the default number depth of
                                            three. To omit the chapter number, a number depth of 2 should be used. In
                                            that case, the section number would be displayed as 1.4.</para>
                                    </listitem>
                                </itemizedlist>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>

                                <programlisting role="XHTML"><![CDATA[<p:document xmlns:p="http://jboss.com/products/seam/pdf"
            title="Hello">

   <p:chapter number="1">
      <p:title><p:paragraph>Hello</p:paragraph></p:title>
      <p:paragraph>Hello #{user.name}!</p:paragraph>
   </p:chapter>

   <p:chapter number="2">
      <p:title><p:paragraph>Goodbye</p:paragraph></p:title>
      <p:paragraph>Goodbye #{user.name}.</p:paragraph>
   </p:chapter>

</p:document> ]]></programlisting>


                            </entry>
                        </row>
                        <row>
				     <entry valign="top">
                                <para>
                                    <literal>&lt;p:header&gt;</literal>
                                </para>
                            </entry>
			         <entry valign="top"> 
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>

                                <para>Any chapter or section can contain a <literal>p:title</literal>. The title will be
                                    displayed next to the chapter/section number. The body of the title may contain raw
                                    text or may be a <literal>p:paragraph</literal>. </para>

                            </entry>
                        </row>
                    </tbody>
                </tgroup>
            </informaltable>
        </section>


        <section id="itext.list">
            <title>Lists</title>

            <para>List structures can be displayed using the <literal>p:list</literal> and <literal>p:listItem</literal>
                tags. Lists may contain arbitrarily-nested sublists. List items may not be used outside of a list. he
                following document uses the <literal>ui:repeat</literal> tag to to display a list of values retrieved
                from a Seam component. </para>

            <programlisting role="XHTML"><![CDATA[<p:document xmlns:p="http://jboss.com/products/seam/pdf"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            title="Hello">
   <p:list style="numbered">
      <ui:repeat value="#{documents}" var="doc">
         <p:listItem>#{doc.name}</p:listItem>
      </ui:repeat>
   </p:list>
</p:document>]]></programlisting>



            <informaltable>
                <tgroup cols="2">
			<!--           <colspec colnum="1" colwidth="1*"/> -->
			<!--           <colspec colnum="2" colwidth="3*"/> -->

                    <tbody>
                        <row>
				    <entry valign="top"> 
                                <para>
                                    <literal>&lt;p:list&gt;</literal>
                                </para>
                            </entry>
			       <entry valign="top"> 
                                <!-- 
                    <para>
                        <emphasis>Description</emphasis>
                    </para>
                    <para>...</para>
                    -->
                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>

                                <itemizedlist>

                                    <listitem>
                                        <para><literal>style</literal> &#8212; The ordering/bulleting style of list.
                                            One of: <literal>NUMBERED</literal>, <literal>LETTERED</literal>,
                                                <literal>GREEK</literal>, <literal>ROMAN</literal>,
                                                <literal>ZAPFDINGBATS</literal>, <literal>ZAPFDINGBATS_NUMBER</literal>.
                                            If no style is given, the list items are bulleted.</para>
                                    </listitem>
                                    <listitem>
                                        <para><literal>listSymbol</literal> &#8212; For bulleted lists, specifies
                                            the bullet symbol. </para>
                                    </listitem>

                                    <listitem>
                                        <para><literal>indent</literal> &#8212; The indentation level of the
                                        list.</para>
                                    </listitem>


                                    <listitem>
                                        <para><literal>lowerCase</literal> &#8212; For list styles using letters,
                                            indicates whether the letters should be lower case.</para>
                                    </listitem>


                                    <listitem>
                                        <para><literal>charNumber</literal> &#8212; For ZAPFDINGBATS, indicates the
                                            character code of the bullet character.</para>
                                    </listitem>


                                    <listitem>
                                        <para><literal>numberType</literal> &#8212; For ZAPFDINGBATS_NUMBER,
                                            indicates the numbering style.</para>
                                    </listitem>

                                </itemizedlist>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML"><![CDATA[<p:list style="numbered">
  <ui:repeat value="#{documents}" var="doc">
    <p:listItem>#{doc.name}</p:listItem>
  </ui:repeat>
</p:list>]]></programlisting>

                            </entry>
                        </row>
                        <row>
				     <entry valign="top"> 
                                <para>
                                    <literal>&lt;p:listItem&gt;</literal>
                                </para>
                            </entry>
			       <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>
                                <para><literal>p:listItem</literal> supports the following attributes:</para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>


                                <itemizedlist>


                                    <listitem>
                                        <para>
                                            <literal>alignment</literal> &#8212; The alignment of the header/footer
                                            box section. (see <xref linkend="itext.alignment"/> for alignment values)</para>

                                    </listitem>

                                    <listitem>
                                        <para><literal>alignment</literal> &#8212; The alignment of the list item.
                                            (See <xref linkend="itext.alignment"/> for possible values)</para>
                                    </listitem>


                                    <listitem>
                                        <para><literal>indentationLeft</literal> &#8212; The left indentation
                                            amount.</para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>indentationRight</literal> &#8212; The right indentation
                                            amount.</para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>listSymbol</literal> &#8212; Overrides the default list
                                            symbol for this list item.</para>
                                    </listitem>


                                </itemizedlist>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML">...</programlisting>

                            </entry>
                        </row>
                    </tbody>
                </tgroup>
            </informaltable>




        </section>

        <section id="itext.tables">
            <title>Tables</title>

            <para>Table structures can be created using the <literal>p:table</literal> and <literal>p:cell</literal>
                tags. Unlike many table structures, there is no explicit row declaration. If a table has 3 columns, then
                every 3 cells will automatically form a row. Header and footer rows can be declared, and the headers and
                footers will be repeated in the event a table structure spans multiple pages.</para>




            <informaltable>
                <tgroup cols="2">
			<!--    <colspec colnum="1" colwidth="1*"/> -->
			<!--    <colspec colnum="2" colwidth="3*"/> -->

                    <tbody>
                        <row>
				    <entry valign="top">
			         <para>
                                    <literal>&lt;p:table&gt;</literal>
                                </para>
                            </entry>
			       <entry valign="top">
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>
                                <para><literal>p:table</literal> supports the following attributes.</para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>

                                <itemizedlist>


                                    <listitem>
                                        <para><literal>columns</literal> &#8212; The number of columns (cells) that
                                            make up a table row.</para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>widths</literal> &#8212; The relative widths of each column.
                                            There should be one value for each column. For example: widths="2 1 1" would
                                            indicate that there are 3 columns and the first column should be twice the
                                            size of the second and third column.</para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>headerRows</literal> &#8212; The initial number of rows which
                                            are considered to be headers or footer rows and should be repeated if the
                                            table spans multiple pages. </para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>footerRows</literal> &#8212; The number of rows that are
                                            considered to be footer rows. This value is subtracted from the
                                                <literal>headerRows</literal> value. If document has 2 rows which make
                                            up the header and one row that makes up the footer,
                                            <literal>headerRows</literal> should be set to 3 and
                                            <literal>footerRows</literal> should be set to 1</para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>widthPercentage</literal> &#8212; The percentage of the page
                                            width that the table spans.</para>
                                    </listitem>

                                    <listitem>
                                        <para><literal>horizontalAlignment</literal> &#8212; The horizontal
                                            alignment of the table. (See <xref linkend="itext.alignment"/> for possible
                                            values)</para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>skipFirstHeader</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>runDirection</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>lockedWidth</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>splitRows</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>spacingBefore</literal> &#8212; The blank space to be
                                            inserted before the element.</para>
                                    </listitem>


                                    <listitem>
                                        <para><literal>spacingAfter</literal> &#8212; The blank space to be inserted
                                            after the element.</para>
                                    </listitem>
                                    <listitem>
                                        <para>
                                            <literal>extendLastRow</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>headersInEvent</literal>
                                        </para>
                                    </listitem>


                                    <listitem>
                                        <para>
                                            <literal>splitLate</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>keepTogether</literal>
                                        </para>
                                    </listitem>

                                </itemizedlist>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML"><![CDATA[<p:table columns="3" headerRows="1">
  <p:cell>name</p:cell>
  <p:cell>owner</p:cell>
  <p:cell>size</p:cell>
  <ui:repeat value="#{documents}" var="doc">
    <p:cell>#{doc.name}</p:cell>
    <p:cell>#{doc.user.name}</p:cell>
    <p:cell>#{doc.size}</p:cell>
  </ui:repeat>
</p:table>]]></programlisting>


                            </entry>
                        </row>
                        <row>
				    <entry valign="top"> 
                                <para>
                                    <literal>&lt;p:cell&gt;</literal>
                                </para>
                            </entry>
			          <entry valign="top"> 
                                <para>
                                    <emphasis>Description</emphasis>
                                </para>
                                <para><literal>p:cell</literal> supports the following attributes.</para>

                                <para>
                                    <emphasis>Attributes</emphasis>
                                </para>


                                <itemizedlist>

                                    <listitem>
                                        <para>
                                            <literal>colspan</literal> &#8212; Cells can span more than one column
                                            by declaring a <literal>colspan</literal> greater than 1. Tables do not have
                                            the ability to span across multiple rows. </para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>horizontalAlignment</literal> &#8212; The horizontal
                                            alignment of the cell. (see <xref linkend="itext.alignment"/> for possible
                                            values)</para>
                                    </listitem>



                                    <listitem>
                                        <para><literal>verticalAlignment</literal> &#8212; The vertical alignment of
                                            the cell. (see <xref linkend="itext.alignment"/> for possible values)</para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>padding</literal> &#8212; Padding on a given side can also be
                                            specified using <literal>paddingLeft</literal>,
                                            <literal>paddingRight</literal>, <literal>paddingTop</literal> and
                                                <literal>paddingBottom</literal>.</para>
                                    </listitem>


                                    <listitem>
                                        <para>
                                            <literal>useBorderPadding</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>leading</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>multipliedLeading</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>indent</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>verticalAlignment</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>extraParagraphSpace</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>fixedHeight</literal>
                                        </para>
                                    </listitem>


                                    <listitem>
                                        <para>
                                            <literal>noWrap</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>minimumHeight</literal>
                                        </para>
                                    </listitem>


                                    <listitem>
                                        <para>
                                            <literal>followingIndent</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>rightIndent</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>spaceCharRatio</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>runDirection</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>arabicOptions</literal>
                                        </para>
                                    </listitem>


                                    <listitem>
                                        <para>
                                            <literal>useAscender</literal>
                                        </para>
                                    </listitem>



                                    <listitem>
                                        <para>
                                            <literal>grayFill</literal>
                                        </para>
                                    </listitem>

                                    <listitem>
                                        <para>
                                            <literal>rotation</literal>
                                        </para>
                                    </listitem>

                                </itemizedlist>
                                <para>
                                    <emphasis>Usage</emphasis>
                                </para>
                                <programlisting role="XHTML"><![CDATA[<p:cell>...</p:cell>]]></programlisting>

                            </entry>
                        </row>
                    </tbody>
                </tgroup>
            </informaltable>


        </section>

        <section id="itext.constant">
            <title>Document Constants</title>

            <para>This section documents some of the constants shared by attributes on multiple tags. </para>

            <section id="itext.colors">
                <title>Color Values</title>
                <para>Seam documents do not yet support a full color specification. Currently, only named colors are
                    supported. They are: <literal>white</literal>, <literal>gray</literal>,
                    <literal>lightgray</literal>, <literal>darkgray</literal>, <literal>black</literal>,
                    <literal>red</literal>, <literal>pink</literal>, <literal>yellow</literal>,
                    <literal>green</literal>, <literal>magenta</literal>, <literal>cyan</literal> and
                    <literal>blue</literal>. </para>

            </section>

            <section id="itext.alignment">
                <title>Alignment Values</title>
                <para> Where alignment values are used, the Seam PDF supports the following horizontal alignment values:
                        <literal>left</literal>, <literal>right</literal>, <literal>center</literal>,
                    <literal>justify</literal> and <literal>justifyall</literal>. The vertical alignment values are
                        <literal>top</literal>, <literal>middle</literal>, <literal>bottom</literal>, and
                        <literal>baseline</literal>.</para>
            </section>

        </section>

        <section id="itext.configuration">
            <title>Configuring iText</title>

            <para>Document generation works out of the box with no additional configuration needed. However, there are a
                few points of configuration that are needed for more serious applications. </para>

            <para> The default implementation serves PDF documents from a generic URL,
                <literal>/seam-doc.seam</literal>. Many browsers (and users) would prefer to see URLs that contain the
                actual PDF name like <literal>/myDocument.pdf</literal>. This capability requires some configuration. To
                serve PDF files, all *.pdf resources should be mapped to the DocumentStoreServlet:</para>

            <programlisting role="XML"><![CDATA[<servlet>
    <servlet-name>Document Store Servlet</servlet-name>
    <servlet-class>org.jboss.seam.pdf.DocumentStoreServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>Document Store Servlet</servlet-name>
    <url-pattern>*.pdf</url-pattern>
</servlet-mapping>]]></programlisting>

            <para> The <literal>use-extensions</literal> option on the document store component completes the
                functionality by instructing the document store to generate URLs with the correct filename extension for
                the document type being generated. </para>

            <programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
            xmlns:pdf="http://jboss.com/products/seam/pdf">
    <pdf:document-store use-extensions="true" />
</components>]]></programlisting>

            <para> Generated documents are stored in conversation scope and will expire when the conversation ends. At
                that point, references to the document will be invalid. To You can specify a default view to be shown
                when a document does not exist using the <literal>error-page</literal> property of the documentStore. </para>
            <programlisting role="XML"><![CDATA[<pdf:document-store use-extensions="true" error-page="/pdfMissing.seam" />]]></programlisting>
        </section>
    </section>


    <section id="itext.charting">
        <title>Charting</title>

        <para> Charting support is also provided with <literal>jboss-seam-pdf.jar</literal>. Charts can be used in PDF
            documents or can be used as images in an HTML page. Charting requires the JFreeChart library
                (<literal>jfreechart.jar</literal> and <literal>jcommon.jar</literal>) to be added to the
                <literal>WEB-INF/lib</literal> directory. Three types of charts are currently supported: pie charts, bar
            charts and line charts. </para>

        <informaltable id="itext.barchart">
            <tgroup cols="2">
		    <!--    <colspec colnum="1" colwidth="1*"/> -->
		    <!--     <colspec colnum="2" colwidth="3*"/> -->

                <tbody>
                    <row>
			         <entry valign="top">
                            <para>
                                <literal>&lt;p:barchart&gt;</literal>
                            </para>
                        </entry> 
			    <entry valign="top"> 
                            <para>
                                <emphasis>Description</emphasis>
                            </para>
                            <para>Displays a bar chart.</para>
                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>
                                <listitem>
                                    <para>
                                        <literal>borderVisible</literal> &#8212; Controls whether or not a border is
                                        displayed around the entire chart. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>borderPaint</literal> &#8212; The color of the border, if visible;
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>borderBackgroundPaint</literal> &#8212; The default background
                                        color of the chart. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>borderStroke</literal> &#8212; </para>
                                </listitem>


                                <listitem>
                                    <para>
                                        <literal>domainAxisLabel</literal> &#8212; The text label for the domain
                                        axis. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>domainAxisPaint</literal> &#8212; The color of the domain axis
                                        label. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>domainGridlinesVisible</literal>&#8212; Controls whether or not
                                        gridlines for the domain axis are shown on the chart. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>domainGridlinePaint</literal>&#8212; The color of the domain
                                        gridlines, if visible. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>domainGridlineStroke</literal> &#8212; The stroke style of the
                                        domain gridleines, if visible. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>height</literal> &#8212; The height of the chart. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>width</literal> &#8212; The width of the chart. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>is3D</literal> &#8212; A boolean value indicating that the chart
                                        should be rendered in 3D instead of 2D. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>legend</literal> &#8212; A boolean value indicating whether or not
                                        the chart should include a legend. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>legendItemPaint</literal>&#8212; The default color of the text
                                        labels in the legend. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>legendItemBackgoundPaint</literal>&#8212; The background color for
                                        the legend, if different from the chart background color.</para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>orientation</literal> &#8212; The orientation of the plot, either
                                            <code>vertical</code> (the default) or <code>horizontal</code>. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>plotBackgroundPaint</literal>&#8212; The color of the plot
                                        background.</para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>plotBackgroundAlpha</literal>&#8212; The alpha (transparency) level
                                        of the plot background. It should be a number between 0 (completely transparent)
                                        and 1 (completely opaque). </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>plotForegroundAlpha</literal>&#8212; The alpha (transparency) level
                                        of the plot. It should be a number between 0 (completely transparent) and 1
                                        (completely opaque). </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>plotOutlinePaint</literal>&#8212; The color of the range gridlines,
                                        if visible. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>plotOutlineStroke</literal> &#8212; The stroke style of the range
                                        gridleines, if visible. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>rangeAxisLabel</literal> &#8212; The text label for the range axis.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>rangeAxisPaint</literal> &#8212; The color of the range axis label.
                                    </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>rangeGridlinesVisible</literal>&#8212; Controls whether or not
                                        gridlines for the range axis are shown on the chart. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>rangeGridlinePaint</literal>&#8212; The color of the range
                                        gridlines, if visible. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>rangeGridlineStroke</literal> &#8212; The stroke style of the range
                                        gridleines, if visible. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>title</literal> &#8212; The chart title text. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>titlePaint</literal>&#8212; The color of the chart title text.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>titleBackgroundPaint</literal>&#8212; The background color around
                                        the chart title.</para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>width</literal> &#8212; The width of the chart. </para>
                                </listitem>

                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>
                            <programlisting role="XHTML"><![CDATA[<p:barchart title="Bar Chart" legend="true"
            width="500" height="500">
    <p:series key="Last Year">
        <p:data columnKey="Joe" value="100" />
        <p:data columnKey="Bob" value="120" />
    </p:series>        <p:series key="This Year">
        <p:data columnKey="Joe" value="125" />
        <p:data columnKey="Bob" value="115" />
    </p:series>
</p:barchart>]]></programlisting>

                        </entry>
                    </row>
                    <row>
			         <entry valign="top">
                            <para>
                                <literal>&lt;p:linechart&gt;</literal>
                            </para>
                        </entry>
		    <entry valign="top"> 
                            <para>
                                <emphasis>Description</emphasis>
                            </para>
                            <para>Displays a line chart.</para>
                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>
                                <listitem>
                                    <para>
                                        <literal>borderVisible</literal> &#8212; Controls whether or not a border is
                                        displayed around the entire chart. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>borderPaint</literal> &#8212; The color of the border, if visible;
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>borderBackgroundPaint</literal> &#8212; The default background
                                        color of the chart. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>borderStroke</literal> &#8212; </para>
                                </listitem>


                                <listitem>
                                    <para>
                                        <literal>domainAxisLabel</literal> &#8212; The text label for the domain
                                        axis. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>domainAxisPaint</literal> &#8212; The color of the domain axis
                                        label. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>domainGridlinesVisible</literal>&#8212; Controls whether or not
                                        gridlines for the domain axis are shown on the chart. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>domainGridlinePaint</literal>&#8212; The color of the domain
                                        gridlines, if visible. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>domainGridlineStroke</literal> &#8212; The stroke style of the
                                        domain gridleines, if visible. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>height</literal> &#8212; The height of the chart. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>width</literal> &#8212; The width of the chart. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>is3D</literal> &#8212; A boolean value indicating that the chart
                                        should be rendered in 3D instead of 2D. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>legend</literal> &#8212; A boolean value indicating whether or not
                                        the chart should include a legend. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>legendItemPaint</literal>&#8212; The default color of the text
                                        labels in the legend. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>legendItemBackgoundPaint</literal>&#8212; The background color for
                                        the legend, if different from the chart background color.</para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>orientation</literal> &#8212; The orientation of the plot, either
                                            <code>vertical</code> (the default) or <code>horizontal</code>. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>plotBackgroundPaint</literal>&#8212; The color of the plot
                                        background.</para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>plotBackgroundAlpha</literal>&#8212; The alpha (transparency) level
                                        of the plot background. It should be a number between 0 (completely transparent)
                                        and 1 (completely opaque). </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>plotForegroundAlpha</literal>&#8212; The alpha (transparency) level
                                        of the plot. It should be a number between 0 (completely transparent) and 1
                                        (completely opaque). </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>plotOutlinePaint</literal>&#8212; The color of the range gridlines,
                                        if visible. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>plotOutlineStroke</literal> &#8212; The stroke style of the range
                                        gridleines, if visible. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>rangeAxisLabel</literal> &#8212; The text label for the range axis.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>rangeAxisPaint</literal> &#8212; The color of the range axis label.
                                    </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>rangeGridlinesVisible</literal>&#8212; Controls whether or not
                                        gridlines for the range axis are shown on the chart. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>rangeGridlinePaint</literal>&#8212; The color of the range
                                        gridlines, if visible. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>rangeGridlineStroke</literal> &#8212; The stroke style of the range
                                        gridleines, if visible. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>title</literal> &#8212; The chart title text. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>titlePaint</literal>&#8212; The color of the chart title text.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>titleBackgroundPaint</literal>&#8212; The background color around
                                        the chart title.</para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>width</literal> &#8212; The width of the chart. </para>
                                </listitem>

                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>
                            <programlisting role="XHTML"><![CDATA[<p:linechart title="Line Chart"
            width="500" height="500">
    <p:series key="Prices">
        <p:data columnKey="2003" value="7.36" />
        <p:data columnKey="2004" value="11.50" />
        <p:data columnKey="2005" value="34.625" />
        <p:data columnKey="2006" value="76.30" />
        <p:data columnKey="2007" value="85.05" />
    </p:series>
</p:linechart>]]></programlisting>

                        </entry>
                    </row>
                    <row>
			        <entry valign="top"> 
                            <para>
                                <literal>&lt;p:piechart&gt;</literal>
                            </para>
                        </entry>
			   <entry valign="top"> 
                            <para>
                                <emphasis>Description</emphasis>
                            </para>
                            <para>Displays a pie chart.</para>
                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>

                                <listitem>
                                    <para>
                                        <literal>title</literal>&#8212; The chart title text. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>label</literal>&#8212; The default label text for pie sections.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>legend</literal>&#8212; A boolean value indicating whether or not
                                        the chart should include a legend. Default value is true </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>is3D</literal>&#8212;A boolean value indicating that the chart
                                        should be rendered in 3D instead of 2D. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelLinkMargin</literal>&#8212; The link margin for labels.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelLinkPaint</literal>&#8212; The paint used for the label
                                        linking lines. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelLinkStroke</literal>&#8212; he stroke used for the label
                                        linking lines. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>labelLinksVisible</literal>&#8212; A flag that controls whether or
                                        not the label links are drawn. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelOutlinePaint</literal>&#8212; The paint used to draw the
                                        outline of the section labels. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelOutlineStroke</literal>&#8212; The stroke used to draw the
                                        outline of the section labels. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelShadowPaint</literal>&#8212; The paint used to draw the shadow
                                        for the section labels. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelPaint</literal>&#8212; The color used to draw the section
                                        labels </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelGap</literal>&#8212; The gap between the labels and the plot
                                        as a percentage of the plot width. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>labelBackgroundPaint</literal>&#8212; The color used to draw the
                                        background of the section labels. If this is null, the background is not filled.
                                    </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>startAngle</literal>&#8212; The starting angle of the first
                                        section. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>circular</literal>&#8212; A boolean value indicating that the chart
                                        should be drawn as a circle. If false, the chart is drawn as an ellipse. The
                                        default is true. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>direction</literal>&#8212; The direction the pie section are drawn.
                                        One of: <literal>clockwise</literal> or <literal>anticlockwise</literal>. The
                                        default is <literal>clockwise</literal>. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>sectionOutlinePaint</literal>&#8212; The outline paint for all
                                        sections. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>sectionOutlineStroke</literal>&#8212; The outline stroke for all
                                        sections </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>sectionOutlinesVisible</literal>&#8212; Indicates whether an
                                        outline is drawn for each section in the plot. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>baseSectionOutlinePaint</literal>&#8212; The base section outline
                                        paint. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>baseSectionPaint</literal>&#8212; The base section paint. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>baseSectionOutlineStroke</literal>&#8212; The base section outline
                                        stroke. </para>
                                </listitem>
                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>
                            <programlisting role="XHTML"><![CDATA[<p:piechart title="Pie Chart" circular="false" direction="anticlockwise" 
    startAngle="30" labelGap="0.1" labelLinkPaint="red">	
    <p:series key="Prices"> 
        <p:data key="2003" columnKey="2003" value="7.36" /> 
        <p:data key="2004" columnKey="2004" value="11.50" /> 
        <p:data key="2005" columnKey="2005" value="34.625" /> 
        <p:data key="2006" columnKey="2006" value="76.30" /> 
        <p:data key="2007" columnKey="2007" value="85.05" /> 
    </p:series> 
</p:piechart>]]></programlisting>

                        </entry>
                    </row>
                    <row>
			          <entry valign="top">
                            <para>
                                <literal>&lt;p:series&gt;</literal>
                            </para>
                        </entry>
		   <entry valign="top"> 
                            <para>
                                <emphasis>Description</emphasis>
                            </para>
                            <para>Category data can be broken down into series. The series tag is used to categorize a
                                set of data with a series and apply styling to the entire series. </para>
                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>

                                <listitem>
                                    <para>
                                        <literal>key</literal> &#8212; The series name. </para>
                                </listitem>
                                <!--
                                <listitem>
                                    <para>
                                        <literal>seriesFillPaint</literal>  &#8212; 
                                    </para>
                                </listitem>
                                -->
                                <listitem>
                                    <para>
                                        <literal>seriesPaint</literal> &#8212; The color of each item in the series
                                    </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>seriesOutlinePaint</literal> &#8212; The outline color for each
                                        item in the series. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>seriesOutlineStroke</literal> &#8212; The stroke used to draw each
                                        item in the series. </para>
                                </listitem>
                                <!--
                                <listitem>
                                    <para>
                                        <literal>seriesStroke</literal>
                                    </para>
                                </listitem>
                                -->
                                <listitem>
                                    <para>
                                        <literal>seriesVisible</literal> &#8212; A boolean indicating if the series
                                        should be displayed. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>seriesVisibleInLegend</literal> &#8212; A boolean indiciating if
                                        the series should be listed in the legend. </para>
                                </listitem>

                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>
                            <programlisting role="XHTML"><![CDATA[<p:series key="data1">
    <ui:repeat value="#{data.pieData1}" var="item">
        <p:data columnKey="#{item.name}" value="#{item.value}" />
    </ui:repeat>
</p:series>]]></programlisting>

                        </entry>
                    </row>
                    <row>
			         <entry valign="top"> 
                            <para>
                                <literal>&lt;p:data&gt;</literal>
                            </para>
                        </entry>
			     <entry valign="top">
                            <para>
                                <emphasis>Description</emphasis>
                            </para>
                            <para>The data tag describes each data point to be displayed in the graph.</para>
                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>
                                <listitem>
                                    <para>
                                        <literal>key</literal> &#8212; The name of the data item. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>series</literal> &#8212; The series name, when not embedded inside
                                        a <code>&lt;p:series&gt;</code>. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>value</literal> &#8212; The numeric data value. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>explodedPercent</literal> &#8212; For pie charts, indicates how
                                        exploded a from the pie a piece is. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>sectionOutlinePaint</literal> &#8212; For bar charts, the color of
                                        the section outline.</para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>sectionOutlineStroke</literal> &#8212; For bar charts, the stroke
                                        type for the section outline.</para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>sectionPaint</literal> &#8212; For bar charts, the color of the
                                        section.</para>
                                </listitem>
                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>



                            <programlisting role="XHTML"><![CDATA[<p:data key="foo" value="20" sectionPaint="#111111" 
        explodedPercent=".2" />
<p:data key="bar" value="30" sectionPaint="#333333" />
<p:data key="baz" value="40" sectionPaint="#555555" 
        sectionOutlineStroke="my-dot-style" />]]></programlisting>

                        </entry>
                    </row>
                    <row>
			            <entry valign="top">
                            <para>
                                <literal>&lt;p:color&gt;</literal>
                            </para>
                        </entry>
			    <entry valign="top"> 
                            <para>
                                <emphasis>Description</emphasis>
                            </para>
                            <para>The color component declares a color or gradient than can be referenced when drawing
                                filled shapes. </para>
                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>

                                <listitem>
                                    <para>
                                        <literal>color</literal> &#8212; The color value. For gradient colors, this
                                        the starting color. <xref linkend="itext.colors"/>
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>color2</literal> &#8212; For gradient colors, this is the color
                                        that ends the gradient. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>point</literal> &#8212; The co-ordinates where the gradient color
                                        begins. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>point2</literal> &#8212; The co-ordinates where the gradient color
                                        ends. </para>
                                </listitem>
                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>
                            <programlisting role="XHTML"><![CDATA[<p:color id="foo" color="#0ff00f"/>
<p:color id="bar" color="#ff00ff" color2="#00ff00" 
                  point="50 50" point2="300 300"/>]]></programlisting>

                        </entry>
                    </row>
                    <row>
			        <entry valign="top"> 
                            <para>
                                <literal>&lt;p:stroke&gt;</literal>
                            </para>
                        </entry>
			   <entry valign="top"> 
                            <para>
                                <emphasis>Description</emphasis>
                            </para>
                            <para>Describes a stroke used to draw lines in a chart.</para>
                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>

                                <listitem>
                                    <para>
                                        <literal>width</literal> &#8212; The width of the stroke. </para>
                                </listitem>

                                <listitem>
                                    <para><literal>cap</literal> &#8212; The line cap type. Valid values are
                                            <literal>butt</literal>, <literal>round</literal> and
                                        <literal>square</literal></para>
                                </listitem>

                                <listitem>
                                    <para><literal>join</literal> &#8212; The line join type. Valid values are
                                            <literal>miter</literal>, <literal>round</literal> and
                                        <literal>bevel</literal></para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>miterLimit</literal> &#8212; For miter joins, this value is the
                                        limit of the size of the join. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>dash</literal> &#8212; The dash value sets the dash pattern to be
                                        used to draw the line. The space separated integers indicate the length of each
                                        alternating drawn and undrawn segments. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>dashPhase</literal> &#8212; The dash phase indicates the offset
                                        into the dash pattern that the the line should be drawn with. </para>
                                </listitem>
                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>
                            <programlisting role="XHTML"><![CDATA[<p:stroke id="dot2" width="2" cap="round" join="bevel" dash="2 3" />]]></programlisting>

                        </entry>
                    </row>
                </tbody>
            </tgroup>
        </informaltable>


    </section>

    <section id="itext.barcodes">
        <title>Bar codes</title>
        <para>Seam can use iText to generate barcodes in a wide variety of formats.  These barcodes can
        be embedded in a PDF document or displayed as an image on a web page. Note that 
        when used with HTML images, barcodes can not currently display barcode text in the barcode. 
        </para>

        <informaltable id="itext.barcode">
            <tgroup cols="2">
		    <!--     <colspec colnum="1" colwidth="1*"/> -->
		    <!--     <colspec colnum="2" colwidth="3*"/> -->

                <tbody>
                    <row>
			       <entry valign="top"> 
                            <para>
                                <literal>&lt;p:barCode&gt;</literal>
                            </para>
                        </entry>
		    <entry valign="top">
                            <para>
                                <emphasis>Description</emphasis>
                            </para>
                            <para>Displays a barcode image.</para>

                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>

                                <listitem>
                                    <para>
                                        <literal>type</literal> &#8212; A barcode type supported by iText. Valid
                                        values include: <literal>EAN13</literal>, <literal>EAN8</literal>,
                                        <literal>UPCA</literal>, <literal>UPCE</literal>, <literal>SUPP2</literal>,
                                            <literal>SUPP5</literal>, <literal>POSTNET</literal>,
                                        <literal>PLANET</literal>, <literal>CODE128</literal>,
                                        <literal>CODE128_UCC</literal>, <literal>CODE128_RAW</literal> and
                                            <literal>CODABAR</literal>. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>code</literal>&#8212; The value to be encoded by the barcode.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>xpos</literal>&#8212; For PDFs, the absolute y position of the
                                        barcode on the page. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>ypos</literal>&#8212; For PDFs, the absolute y position of the
                                        barcode on the page. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>rotDegrees</literal> &#8212; For PDFs, the rotation factor of the
                                        barcode in degrees. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>barHeight</literal> &#8212; The height of the bars in the barCode
                                    </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>minBarWidth</literal> &#8212; The minimum bar width. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>barMultiplier</literal> &#8212; The bar multiplier for wide bars or
                                        the distance between bars for <literal>POSTNET</literal> and
                                        <literal>PLANET</literal> code. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>barColor</literal> &#8212; The color to draw the bars. </para>
                                </listitem>

                                <listitem>
                                    <para>
                                        <literal>textColor</literal> &#8212; The color of any text on the barcode.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>textSize</literal> &#8212; The size of the barcode text, if any.
                                    </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>altText</literal> &#8212; The <literal>alt</literal> text for HTML image links.
                                    </para>
                                </listitem>                                                                


                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>
                            <programlisting role="XHTML"><![CDATA[<p:barCode type="code128" 
           barHeight="80" 
           textSize="20" 
           code="(10)45566(17)040301" 
           codeType="code128_ucc" 
           altText="My BarCode" />]]></programlisting>

                        </entry>
                    </row>
                </tbody>
            </tgroup>
        </informaltable>
    </section>


    <section id="itext.swingcomponents">
        <title>Rendering Swing/AWT components</title>
        <para>Seam now provides experimental support for rendering Swing components to into a PDF
        image.  Some Swing look and feels supports, notably ones that use native widgets, will not
        render correctly.
        </para>

        <informaltable id="itext.swing">
            <tgroup cols="2">
        <!--        <colspec colnum="1" colwidth="1*"/>
                <colspec colnum="2" colwidth="3*"/> -->

                <tbody>
                    <row>
                      <entry valign="top"> 
                            <para>
                                <literal>&lt;p:swing&gt;</literal>
                            </para>
                        </entry>
                       <entry valign="top">
                            <para>
                                <emphasis>Description</emphasis>  
                            </para>
                            
                            <para>Renders a Swing component into a PDF document.</para>
                            <para>
                                <emphasis>Attributes</emphasis>
                            </para>

                            <itemizedlist>

                                <listitem>
                                    <para>
                                        <literal>width</literal> &#8212; The width of the component to be rendered. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>height</literal> &#8212; ..The height of the component to be rendered. </para>
                                </listitem>
                                <listitem>
                                    <para>
                                        <literal>component</literal> &#8212; An expression whose value is a Swing or AWT component. </para>
                                </listitem>                                

                            </itemizedlist>
                            <para>
                                <emphasis>Usage</emphasis>
                            </para>
                            <programlisting role="XHTML"><![CDATA[<p:swing width="310" height="120" component="#{aButton}" />]]></programlisting>

                        </entry>
                    </row>
                </tbody>
            </tgroup>
        </informaltable>
    </section>


    <section id="itext.links">
        <title>Further documentation</title>

        <para>For further information on iText, see:</para>
        <para>
            <itemizedlist>
                <listitem>
                    <para>
                        <ulink url="http://www.lowagie.com/iText/">iText Home Page</ulink>
                    </para>
                </listitem>
                <listitem>
                    <para>
                        <ulink url="http://www.manning.com/lowagie/">iText in Action</ulink>
                    </para>
                </listitem>
            </itemizedlist>

        </para>
    </section>
</chapter>
