com.crionics.jpdf
Class CreatorModule

java.lang.Object
  extended by PdfModule
      extended by com.crionics.jpdf.AbstractModule
          extended by com.crionics.jpdf.CreatorModule

public final class CreatorModule
extends AbstractModule

Module used to create new PDF contents, such as text, graphics, pages and outlines.


Field Summary
 
Fields inherited from class com.crionics.jpdf.AbstractModule
MOD_CREATOR, MOD_DESCRIPTION, MOD_ENCRYPTION, MOD_MERGER, MOD_PRINTER, MOD_SECURITY, MOD_SIGNER, MOD_TEMPLATE
 
Method Summary
 Outline createOutline()
          Creates a new outline Object in the document, where you will be able to add your the different Items.
 LayerProperty getLayerProperty(java.lang.String layerName)
          Returns the properties associated with the given layer name
 AbstractDestinationPage getNamedDestination(java.lang.String name)
          This method gets a named destination from the document. one typical use of named destinations is to open a document on a given page.
 java.util.List getNamedDestinations()
          This method returns the list of destinations defined in the document.
 Outline getOutline()
          Recovers the Outline present in the current document if presents.
 Page getPage(int i)
          Gets the page at index i
 void removeNamedDestination(java.lang.String name)
          This method deletes the given named destination from the document.
 void setNamedDestination(java.lang.String name, AbstractDestinationPage destination)
          This method sets a named destination in the document. one typical use of named destinations is to open a document on a given page.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createOutline

public Outline createOutline()
                      throws PdfException,
                             java.io.IOException
Creates a new outline Object in the document, where you will be able to add your the different Items.

Returns:
The outline.
Throws:
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.

getLayerProperty

public LayerProperty getLayerProperty(java.lang.String layerName)
                               throws PdfException,
                                      java.io.IOException
Returns the properties associated with the given layer name

Parameters:
layerName - the layer name as defined in the list of layers
Returns:
the properties associated with the given layer name
Throws:
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.

getNamedDestination

public AbstractDestinationPage getNamedDestination(java.lang.String name)
                                            throws java.io.IOException,
                                                   PdfException
This method gets a named destination from the document. one typical use of named destinations is to open a document on a given page.

Parameters:
name - the name of the destination, typicaly used from a URL
Returns:
the given destination or null
Throws:
java.io.IOException
PdfException

getNamedDestinations

public java.util.List getNamedDestinations()
                                    throws PdfException,
                                           java.io.IOException
This method returns the list of destinations defined in the document.

Returns:
a list of string, each string is the unique name identifying the named destination. The List is empty is there are no destination defined.
Throws:
PdfException, - IOException
PdfException
java.io.IOException

getOutline

public Outline getOutline()
                   throws java.io.IOException,
                          PdfException
Recovers the Outline present in the current document if presents.

Returns:
The existing Outline present in the document, or null if none are present.
Throws:
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.

getPage

public Page getPage(int i)
             throws java.io.IOException,
                    PdfException
Gets the page at index i

Parameters:
i - the page index
Returns:
the page at index i
Throws:
java.io.IOException - low level problem
PdfException - page is out of bounds

removeNamedDestination

public void removeNamedDestination(java.lang.String name)
                            throws java.io.IOException,
                                   PdfException
This method deletes the given named destination from the document.

Parameters:
name - the name of the destination, typically used from a URL
Throws:
java.io.IOException
PdfException

setNamedDestination

public void setNamedDestination(java.lang.String name,
                                AbstractDestinationPage destination)
                         throws java.io.IOException,
                                PdfException
This method sets a named destination in the document. one typical use of named destinations is to open a document on a given page. The typical destination est created using the code below LocalPageDestination dest = LocalPageDestination.createInstance(doc);
dest.setPageIndex(1);
doc.getCreatorModule().setNamedDestination("Chap1", dest);

Parameters:
name - the name of the destination, typically used from a URL
destination - the "action" to perform
Throws:
java.io.IOException
PdfException


Copyright © 1999-2007 Crionics. All Rights Reserved.