PDF Clown
0.0.8

it.stefanochizzolini.clown.documents.contents.xObjects
Class FormXObject

java.lang.Object
  extended by it.stefanochizzolini.clown.objects.PdfObjectWrapper<PdfStream>
      extended by it.stefanochizzolini.clown.documents.contents.xObjects.XObject
          extended by it.stefanochizzolini.clown.documents.contents.xObjects.FormXObject
All Implemented Interfaces:
IContentContext, IContentEntity

public class FormXObject
extends XObject
implements IContentContext

Form external object [PDF:1.6:4.9].

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

Constructor Summary
FormXObject(Document context)
          Creates a new form within the given document context, using default resources.
FormXObject(Document context, Resources resources)
          Creates a new form within the given document context, using custom resources.
FormXObject(PdfDirectObject baseObject)
          For internal use only.
 
Method Summary
 FormXObject clone(Document context)
          Gets a clone of the object, registered inside the given document context.
 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 content stream associated to the form.
 double[] getMatrix()
          Gets the mapping from external-object space to user space.
 Resources getResources()
          Gets the resources associated to the form.
 Dimension2D getSize()
          Gets the form size.
 void setResources(Resources value)
          Sets the resources associated to the form.
 void setSize(Dimension2D value)
          Sets the form size.
 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].
 
Methods inherited from class it.stefanochizzolini.clown.documents.contents.xObjects.XObject
wrap
 
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

FormXObject

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


FormXObject

public FormXObject(Document context,
                   Resources resources)
Creates a new form within the given document context, using custom resources.

Since:
0.0.5

FormXObject

public FormXObject(PdfDirectObject baseObject)
For internal use only.

Method Detail

clone

public FormXObject 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<PdfStream>
Parameters:
context - Which document the clone has to be registered in.

getMatrix

public double[] getMatrix()
Description copied from class: XObject
Gets the mapping from external-object space to user space.

Specified by:
getMatrix in class XObject
Since:
0.0.5

getSize

public Dimension2D getSize()
Gets the form size.

Specified by:
getSize in class XObject

setResources

public void setResources(Resources value)
Sets the resources associated to the form.


setSize

public void setSize(Dimension2D value)
Sets the form size.

Specified by:
setSize in class XObject

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()
Gets the content stream associated to the form.

Specified by:
getContents in interface IContentContext

getResources

public Resources getResources()
Gets the resources associated to the form.

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

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.