PDF Clown
0.1.2

org.pdfclown.documents
Class Document

java.lang.Object
  extended by org.pdfclown.objects.PdfObjectWrapper<PdfDictionary>
      extended by org.pdfclown.documents.Document
All Implemented Interfaces:
Pageable, Cloneable, IPdfObjectWrapper

@PDF(value=PDF10)
public final class Document
extends PdfObjectWrapper<PdfDictionary>
implements Pageable

PDF document [PDF:1.6:3.6.1].

Version:
0.1.2, 12/28/12
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Nested Class Summary
static class Document.Configuration
          Document configuration.
static class Document.PageLayoutEnum
          Page layout to be used when the document is opened [PDF:1.6:3.6.1].
static class Document.PageModeEnum
          Page mode specifying how the document should be displayed when opened [PDF:1.6:3.6.1].
 
Field Summary
 Hashtable<PdfReference,Object> cache
          For internal use only.
 
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
 
Constructor Summary
Document(File context)
          For internal use only.
Document(PdfDirectObject baseObject)
          For internal use only.
 
Method Summary
 Document clone(Document context)
          Gets a clone of the object, registered inside the given document context.
 void exclude(Collection<? extends PdfObjectWrapper<?>> objects)
          Deletes the objects from this document context.
 void exclude(PdfObjectWrapper<?> object)
          Deletes the object from this document context.
 DocumentActions getActions()
          Gets the document's behavior in response to trigger events.
 Articles getArticles()
          Gets the article threads.
 Bookmarks getBookmarks()
          Gets the bookmark collection.
 Document.Configuration getConfiguration()
          Gets the configuration of this document.
 Form getForm()
          Gets the interactive form (AcroForm).
 Information getInformation()
          Gets common document metadata.
 LayerDefinition getLayer()
          Gets the optional content properties.
 Names getNames()
          Gets the name dictionary.
 int getNumberOfPages()
           
 PageFormat getPageFormat(int pageIndex)
           
 PageLabels getPageLabels()
          Gets the page label ranges.
 Document.PageLayoutEnum getPageLayout()
          Gets the page layout to be used when the document is opened.
 Document.PageModeEnum getPageMode()
          Gets the page mode, that is how the document should be displayed when is opened.
 Pages getPages()
          Gets the page collection.
 Dimension2D getPageSize()
          Gets the default page size [PDF:1.6:3.6.2].
 Printable getPrintable(int pageIndex)
           
 Resources getResources()
          Gets the default resource collection [PDF:1.6:3.6.2].
 Dimension2D getSize()
          Gets the document size, that is the maximum page dimensions across the whole document.
 Version getVersion()
          Gets the version of the PDF specification this document conforms to.
 ViewerPreferences getViewerPreferences()
          Gets the way the document is to be presented.
 Collection<? extends PdfObjectWrapper<?>> include(Collection<? extends PdfObjectWrapper<?>> objects)
          Clones the specified collection objects within this document context.
 PdfObjectWrapper<?> include(PdfObjectWrapper<?> object)
          Clones the specified object within this document context.
static
<T extends PdfObjectWrapper<?>>
T
resolve(Class<T> type, PdfDirectObject baseObject)
           
<T extends PdfObjectWrapper<?>>
T
resolveName(Class<T> type, PdfDirectObject namedBaseObject)
          Forces a named base object to be expressed as its corresponding high-level representation.
 void setActions(DocumentActions value)
           
 void setArticles(Articles value)
           
 void setBookmarks(Bookmarks value)
           
 void setConfiguration(Document.Configuration value)
           
 void setForm(Form value)
           
 void setInformation(Information value)
           
 void setLayer(LayerDefinition value)
           
 void setNames(Names value)
           
 void setPageLabels(PageLabels value)
           
 void setPageLayout(Document.PageLayoutEnum value)
           
 void setPageMode(Document.PageModeEnum value)
           
 void setPages(Pages value)
           
 void setPageSize(Dimension2D value)
           
 void setResources(Resources value)
           
 void setVersion(Version value)
           
 void setViewerPreferences(ViewerPreferences value)
           
 
Methods inherited from class org.pdfclown.objects.PdfObjectWrapper
checkCompatibility, delete, equals, exists, getBaseDataObject, getBaseObject, getBaseObject, getContainer, getDataContainer, getDocument, getFile, getMetadata, retrieveName, retrieveNamedBaseObject, setBaseObject, setMetadata
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

public Hashtable<PdfReference,Object> cache
For internal use only.

Constructor Detail

Document

public Document(File context)
For internal use only.


Document

public Document(PdfDirectObject baseObject)
For internal use only.

Method Detail

resolve

public static <T extends PdfObjectWrapper<?>> T resolve(Class<T> type,
                                                        PdfDirectObject baseObject)

clone

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

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

exclude

public void exclude(PdfObjectWrapper<?> object)
Deletes the object from this document context.


exclude

public void exclude(Collection<? extends PdfObjectWrapper<?>> objects)
Deletes the objects from this document context.


getActions

@PDF(value=PDF14)
public DocumentActions getActions()
Gets the document's behavior in response to trigger events.


getArticles

@PDF(value=PDF11)
public Articles getArticles()
Gets the article threads.


getBookmarks

public Bookmarks getBookmarks()
Gets the bookmark collection.


getConfiguration

public final Document.Configuration getConfiguration()
Gets the configuration of this document.


getForm

@PDF(value=PDF12)
public Form getForm()
Gets the interactive form (AcroForm).

Since:
0.0.7

getInformation

public Information getInformation()
Gets common document metadata.


getLayer

@PDF(value=PDF15)
public LayerDefinition getLayer()
Gets the optional content properties.


getNames

@PDF(value=PDF12)
public Names getNames()
Gets the name dictionary.


getPageLabels

@PDF(value=PDF13)
public PageLabels getPageLabels()
Gets the page label ranges.


getPageLayout

public Document.PageLayoutEnum getPageLayout()
Gets the page layout to be used when the document is opened.


getPageMode

public Document.PageModeEnum getPageMode()
Gets the page mode, that is how the document should be displayed when is opened.


getPages

public Pages getPages()
Gets the page collection.


getPageSize

public Dimension2D getPageSize()
Gets the default page size [PDF:1.6:3.6.2].

See Also:
getSize()

getResources

public Resources getResources()
Gets the default resource collection [PDF:1.6:3.6.2].

The default resource collection is used as last resort by every page that doesn't reference one explicitly (and doesn't reference an intermediate one implicitly).


getSize

public Dimension2D getSize()
Gets the document size, that is the maximum page dimensions across the whole document.

See Also:
getPageSize()

getVersion

@PDF(value=PDF14)
public Version getVersion()
Gets the version of the PDF specification this document conforms to.


getViewerPreferences

@PDF(value=PDF12)
public ViewerPreferences getViewerPreferences()
Gets the way the document is to be presented.


include

public PdfObjectWrapper<?> include(PdfObjectWrapper<?> object)
Clones the specified object within this document context.


include

public Collection<? extends PdfObjectWrapper<?>> include(Collection<? extends PdfObjectWrapper<?>> objects)
Clones the specified collection objects within this document context.


resolveName

public <T extends PdfObjectWrapper<?>> T resolveName(Class<T> type,
                                                     PdfDirectObject namedBaseObject)
Forces a named base object to be expressed as its corresponding high-level representation.


setActions

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

setArticles

public void setArticles(Articles value)
See Also:
getArticles()

setBookmarks

public void setBookmarks(Bookmarks value)
See Also:
getBookmarks()

setConfiguration

public void setConfiguration(Document.Configuration value)
Since:
0.1.0
See Also:
getConfiguration()

setForm

public void setForm(Form value)
Since:
0.0.7
See Also:
getForm()

setInformation

public void setInformation(Information value)
See Also:
getInformation()

setLayer

public void setLayer(LayerDefinition value)
See Also:
getLayer()

setNames

public void setNames(Names value)
Since:
0.0.4
See Also:
getNames()

setPageLabels

public void setPageLabels(PageLabels value)
See Also:
getPageLabels()

setPageLayout

public void setPageLayout(Document.PageLayoutEnum value)
See Also:
getPageLayout()

setPageMode

public void setPageMode(Document.PageModeEnum value)
See Also:
getPageMode()

setPages

public void setPages(Pages value)
See Also:
getPages()

setPageSize

public void setPageSize(Dimension2D value)
See Also:
getPageSize()

setResources

public void setResources(Resources value)
See Also:
getResources()

setVersion

public void setVersion(Version value)
See Also:
getVersion()

setViewerPreferences

public void setViewerPreferences(ViewerPreferences value)
See Also:
getViewerPreferences()

getNumberOfPages

public int getNumberOfPages()
Specified by:
getNumberOfPages in interface Pageable

getPageFormat

public PageFormat getPageFormat(int pageIndex)
                         throws IndexOutOfBoundsException
Specified by:
getPageFormat in interface Pageable
Throws:
IndexOutOfBoundsException

getPrintable

public Printable getPrintable(int pageIndex)
                       throws IndexOutOfBoundsException
Specified by:
getPrintable in interface Pageable
Throws:
IndexOutOfBoundsException

PDF Clown
0.1.2

Project home page

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