PDF Clown
0.0.8

it.stefanochizzolini.clown.documents
Class Page

java.lang.Object
  extended by it.stefanochizzolini.clown.objects.PdfObjectWrapper<PdfDictionary>
      extended by it.stefanochizzolini.clown.documents.Page
All Implemented Interfaces:
IContentContext, IContentEntity

public class Page
extends PdfObjectWrapper<PdfDictionary>
implements IContentContext

Document page [PDF:1.6:3.6.2].

Since:
0.0.0
Version:
0.0.8
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Nested Class Summary
static class Page.TabOrderEnum
          Annotations tab order [PDF:1.6:3.6.2].
 
Constructor Summary
Page(Document context)
          Creates a new page within the given document context, using default resources.
Page(Document context, Dimension2D size, Resources resources)
          Creates a new page within the given document context, using custom resources.
Page(PdfDirectObject baseObject)
          For internal use only.
 
Method Summary
 Page clone(Document context)
          Gets a clone of the object, registered inside the given document context.
 PageActions getActions()
          Gets the page's behavior in response to trigger events.
 PageAnnotations getAnnotations()
          Gets the annotations associated to the page.
 Rectangle2D getBox()
          Gets the bounding box associated with the object, either explicitly (directly associated to the object) or (if not explicitly available) implicitly (inherited from a higher level object).
 Contents getContents()
          Gets the contents collection representing the content stream.
 double getDuration()
          Gets the page's display duration.
 int getIndex()
          Gets the index of the page.
protected  PdfDirectObject getInheritableAttribute(PdfName key)
           
 Resources getResources()
          Gets the resources associated with the object, either explicitly (directly associated to the object) or (if not explicitly available) implicitly (inherited from a higher-level object).
 Dimension2D getSize()
          Gets the page size.
 Page.TabOrderEnum getTabOrder()
          Gets the tab order to be used for annotations on the page.
 Transition getTransition()
          Gets the transition effect to be used when displaying the page during presentations.
 void setActions(PageActions value)
           
 void setAnnotations(PageAnnotations value)
           
 void setDuration(double value)
           
 void setSize(Dimension2D value)
           
 void setTabOrder(Page.TabOrderEnum value)
           
 void setTransition(Transition value)
           
 ContentObject toInlineObject(PrimitiveFilter context)
          Converts the entity to its equivalent inline (dependent) object representation [PDF:1.6:4.8.6].
 XObject toXObject(Document context)
          Converts the entity to its equivalent external (independent) object representation [PDF:1.6:4.7].
static Page wrap(PdfReference reference)
           
 
Methods inherited from class it.stefanochizzolini.clown.objects.PdfObjectWrapper
delete, getBaseDataObject, getBaseObject, getContainer, getDocument, getFile, setBaseObject, setContainer, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Page

public Page(Document context)
Creates a new page within the given document context, using default resources.


Page

public Page(Document context,
            Dimension2D size,
            Resources resources)
Creates a new page within the given document context, using custom resources.


Page

public Page(PdfDirectObject baseObject)
For internal use only.

Method Detail

wrap

public static Page wrap(PdfReference reference)

clone

public Page clone(Document context)
Description copied from class: PdfObjectWrapper
Gets a clone of the object, registered inside the given document context.

Specified by:
clone in class PdfObjectWrapper<PdfDictionary>
Parameters:
context - Which document the clone has to be registered in.

getActions

public PageActions getActions()
Gets the page's behavior in response to trigger events.


getAnnotations

public PageAnnotations getAnnotations()
Gets the annotations associated to the page.


getDuration

public double getDuration()
Gets the page's display duration.

The page's display duration (also called its advance timing) is the maximum length of time, in seconds, that the page is displayed during presentations before the viewer application automatically advances to the next page.

By default, the viewer does not advance automatically.


getIndex

public int getIndex()
Gets the index of the page.

Remarks

The page index is not an explicit datum, therefore it needs to be inferred from the position of the page object inside the page tree, requiring a significant amount of computation: invoke it sparingly!


getSize

public Dimension2D getSize()
Gets the page size.


getTabOrder

public Page.TabOrderEnum getTabOrder()
Gets the tab order to be used for annotations on the page.


getTransition

public Transition getTransition()
Gets the transition effect to be used when displaying the page during presentations.


setActions

public void setActions(PageActions value)
See Also:
getActions()

setAnnotations

public void setAnnotations(PageAnnotations value)
See Also:
getAnnotations()

setDuration

public void setDuration(double value)
See Also:
getDuration()

setSize

public void setSize(Dimension2D value)
See Also:
getSize()

setTabOrder

public void setTabOrder(Page.TabOrderEnum value)
See Also:
getTabOrder()

setTransition

public void setTransition(Transition value)
See Also:
getTransition()

getBox

public Rectangle2D getBox()
Description copied from interface: IContentContext
Gets the bounding box associated with the object, either explicitly (directly associated to the object) or (if not explicitly available) implicitly (inherited from a higher level object).

Remarks

The box represents the physical-coordinates frame expressed in default user-space units. This frame is crucial for the proper positioning of graphic elements on the canvas, as the spec [PDF:1.6:4.2] states that the coordinate system is positively-oriented, although the typographic coordinates would be conveniently expressed as negatively-oriented.

Specified by:
getBox in interface IContentContext

getContents

public Contents getContents()
Description copied from interface: IContentContext
Gets the contents collection representing the content stream.

Specified by:
getContents in interface IContentContext

getResources

public Resources getResources()
Description copied from interface: IContentContext
Gets the resources associated with the object, either explicitly (directly associated to the object) or (if not explicitly available) implicitly (inherited from a higher-level object).

Remarks

The implementing class MUST ensure that the returned object isn't null.

Specified by:
getResources in interface IContentContext

toInlineObject

public ContentObject toInlineObject(PrimitiveFilter context)
Description copied from interface: IContentEntity
Converts the entity to its equivalent inline (dependent) object representation [PDF:1.6:4.8.6].

Remarks

This method creates and shows an inline object within the target content context, returning it.

Due to its direct-content nature (opposite to the indirect-content nature of external objects (see IContentEntity.toXObject(Document))), the resulting object should be shown only one time in order not to wastefully duplicate its data.

Specified by:
toInlineObject in interface IContentEntity
Parameters:
context - Target content context.
Returns:
The inline object representing the entity.
Since:
0.0.6

toXObject

public XObject toXObject(Document context)
Description copied from interface: IContentEntity
Converts the entity to its equivalent external (independent) object representation [PDF:1.6:4.7].

Remarks

This method creates an external object within the target document, returning it. To show it in a content context (for example: a page), then it must be applied in an appropriate manner (see PrimitiveFilter object).

Specified by:
toXObject in interface IContentEntity
Parameters:
context - Target document.
Returns:
The external object representing the entity.
Since:
0.0.5

getInheritableAttribute

protected PdfDirectObject getInheritableAttribute(PdfName key)

PDF Clown
0.0.8

Project home page

Copyright © 2006-2010 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.