Class ITextUtil


  • public class ITextUtil
    extends java.lang.Object
    A set of util methods for the iText framework
    Version:
    $Id: ITextUtil.java 1003453 2010-10-01 09:45:16Z ltheussl $
    Author:
    Vincent Siveton
    • Constructor Summary

      Constructors 
      Constructor Description
      ITextUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.lowagie.text.Rectangle getDefaultPageSize()
      Set the default page size for the document depending the user's country.
      static java.lang.String getPageSize​(com.lowagie.text.Rectangle rect)
      Return a page size as String.
      static boolean isPageSizeSupported​(java.lang.String aPageSize)
      Return true if the page size is supported by PageSize class, false otherwise.
      static void writeHtml​(java.io.InputStream is, java.io.OutputStream os)
      Parse an iText XML from the specified InputStream, writing an html document specified OutputStream.
      static void writePdf​(java.io.InputStream is, java.io.OutputStream os)
      Parse an iText XML from the specified InputStream, writing an Pdf document specified OutputStream.
      static void writeRtf​(java.io.InputStream is, java.io.OutputStream os)
      Parse an iText XML from the specified InputStream, writing an rtf document specified OutputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ITextUtil

        public ITextUtil()
    • Method Detail

      • getDefaultPageSize

        public static com.lowagie.text.Rectangle getDefaultPageSize()
        Set the default page size for the document depending the user's country. TODO Maybe more generic?
        Returns:
        the page size
        See Also:
        PageSize
      • getPageSize

        public static java.lang.String getPageSize​(com.lowagie.text.Rectangle rect)
        Return a page size as String.
        Parameters:
        rect - a Rectangle defined in PageSize.
        Returns:
        a page size as String or A4 if not found.
        See Also:
        PageSize
      • isPageSizeSupported

        public static boolean isPageSizeSupported​(java.lang.String aPageSize)
        Return true if the page size is supported by PageSize class, false otherwise.
        Parameters:
        aPageSize - a page size
        Returns:
        true if the page size is supported, false otherwise
        See Also:
        PageSize
      • writePdf

        public static void writePdf​(java.io.InputStream is,
                                    java.io.OutputStream os)
        Parse an iText XML from the specified InputStream, writing an Pdf document specified OutputStream.
        Parameters:
        is - the InputStream from which the XML is read.
        os - the OutputStream to which the result as Pdf is written.
        See Also:
        XmlToPdf
      • writeRtf

        public static void writeRtf​(java.io.InputStream is,
                                    java.io.OutputStream os)
        Parse an iText XML from the specified InputStream, writing an rtf document specified OutputStream.
        Parameters:
        is - the InputStream from which the XML is read.
        os - the OutputStream to which the result as RTF is written.
        See Also:
        XmlToRtf
      • writeHtml

        public static void writeHtml​(java.io.InputStream is,
                                     java.io.OutputStream os)
        Parse an iText XML from the specified InputStream, writing an html document specified OutputStream.
        Parameters:
        is - the InputStream from which the XML is read.
        os - the OutputStream to which the result as Html is written.
        See Also:
        XmlToHtml