com.arctorus.documents
Class Document

java.lang.Object
  extended by com.arctorus.documents.Document

public final class Document
extends java.lang.Object

Main class to create new documents.


Constructor Summary
Document()
          Creates new empty document.
 
Method Summary
 Page createPage()
          Create and return new page in the document.
 Page createPage(java.lang.String pageName)
          Create and return new page in the document.
 BorderStyleManager getBorderStyleManager()
          Gets manager of border styles defined for this document.
 CellStyleManager getCellStyleManager()
          Gets manager of cell styles defined for this document.
 DocumentProperties getDocumentProperties()
          Gets standard properties of a document.
 Page getFirstPage()
          Get the first page of a document.
 java.util.List<Page> getPages()
          Get read-only unmodifiable list of all pages in a document.
 PageSize getPageSize()
          Get PageSize object which allows to read and change page properties.
 void save(ExportType exportType, java.io.InputStream templateDocument, java.io.OutputStream outputStream)
          Save document to the provided output stream in specified file format using template presentation.
 void save(ExportType exportType, java.io.OutputStream outputStream)
          Save document to the provided output stream in specified file format.
 void save(ExportType exportType, java.lang.String outputPath)
          Save document to the provided output stream in specified file format.
 void save(ExportType exportType, java.lang.String templatePath, java.lang.String outputPath)
          Save document to the provided output stream in specified file format using template presentation.
 void setLicense(java.io.InputStream licenseStream)
          Read license from input stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

public Document()
Creates new empty document.

Method Detail

setLicense

public void setLicense(java.io.InputStream licenseStream)
                throws LicenseException,
                       java.io.IOException
Read license from input stream.

Parameters:
licenseStream - stream to read license from.
Throws:
LicenseException
java.io.IOException

getDocumentProperties

public DocumentProperties getDocumentProperties()
Gets standard properties of a document.


createPage

public Page createPage()
Create and return new page in the document.
Remember that the first page is already created.


createPage

public Page createPage(java.lang.String pageName)
Create and return new page in the document.
Remember that the first page is already created.


getFirstPage

public Page getFirstPage()
Get the first page of a document.


getPages

public java.util.List<Page> getPages()
Get read-only unmodifiable list of all pages in a document.


getCellStyleManager

public CellStyleManager getCellStyleManager()
Gets manager of cell styles defined for this document.


getBorderStyleManager

public BorderStyleManager getBorderStyleManager()
Gets manager of border styles defined for this document.


getPageSize

public PageSize getPageSize()
Get PageSize object which allows to read and change page properties.


save

public void save(ExportType exportType,
                 java.lang.String outputPath)
          throws DocumentException,
                 java.io.IOException
Save document to the provided output stream in specified file format.

Parameters:
exportType - document format.
outputPath - output file path.
Throws:
DocumentException
java.io.IOException

save

public void save(ExportType exportType,
                 java.io.OutputStream outputStream)
          throws DocumentException,
                 java.io.IOException
Save document to the provided output stream in specified file format.

Parameters:
exportType - document format.
outputStream - output stream.
Throws:
DocumentException
java.io.IOException

save

public void save(ExportType exportType,
                 java.io.InputStream templateDocument,
                 java.io.OutputStream outputStream)
          throws DocumentException,
                 java.io.IOException
Save document to the provided output stream in specified file format using template presentation.

Parameters:
exportType - document format.
templateDocument - input stream with template document.
outputStream - output stream.
Throws:
DocumentException
java.io.IOException

save

public void save(ExportType exportType,
                 java.lang.String templatePath,
                 java.lang.String outputPath)
          throws DocumentException,
                 java.io.IOException
Save document to the provided output stream in specified file format using template presentation.

Parameters:
exportType - document format.
templatePath - input file path with template document.
outputPath - output file path.
Throws:
DocumentException
java.io.IOException