org.foray.pdf.object
Class PDFPage

java.lang.Object
  extended by org.foray.pdf.object.PDFObject
      extended by org.foray.pdf.object.PDFPage
All Implemented Interfaces:
org.axsl.pdf.PdfPage

public class PDFPage
extends PDFObject
implements org.axsl.pdf.PdfPage

A PDF Page. There is one of these for every page in a PDF document. The object specifies the dimensions of the page and references a /Resources object, a contents stream and the page's parent in the page hierarchy.


Field Summary
 
Fields inherited from class org.foray.pdf.object.PDFObject
EOL, MSG_EOL, XREF_EOL
 
Constructor Summary
PDFPage(PDFDocument doc, PDFResources resources, int pagewidth, int pageheight)
          Create a /Page object.
 
Method Summary
 void addAnnotationList(PDFAnnotList listToAdd)
          Add an annotation list to the annotations on this page.
 void addShading(PDFShading shading)
          Add a shading to this page.
 PDFDestination createDestination(float xPosition, float yPosition)
           
 PDFContentStream getContentStream()
           
 PDFLink makeLink(Rectangle2D rect, String destination, boolean externalLink)
           
 void setParent(PDFPages parent)
          Set this page's parent.
 String toPDF()
          Generates the PDF text necessary to represent the object, returning it as a String.
 
Methods inherited from class org.foray.pdf.object.PDFObject
bufferToByteArray, byteArrayToStream, getCharsPerLine, getGeneration, getLogger, getNumber, getPDFDocument, output, pdfID, pdfReference, setNumber, stringToByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFPage

public PDFPage(PDFDocument doc,
               PDFResources resources,
               int pagewidth,
               int pageheight)
Create a /Page object.

Parameters:
doc - The PDF document being built.
resources - the /Resources object
pagewidth - the page's width in points
pageheight - the page's height in points
Method Detail

setParent

public void setParent(PDFPages parent)
Set this page's parent.

Parameters:
parent - the /Pages object that is this page's parent

addShading

public void addShading(PDFShading shading)
Add a shading to this page.

Parameters:
shading - The shading to be added.

toPDF

public String toPDF()
Description copied from class: PDFObject
Generates the PDF text necessary to represent the object, returning it as a String.

Returns:
The PDF text necessary to represent the object.

addAnnotationList

public void addAnnotationList(PDFAnnotList listToAdd)
Add an annotation list to the annotations on this page.

Parameters:
listToAdd - The annotation list to add.

makeLink

public PDFLink makeLink(Rectangle2D rect,
                        String destination,
                        boolean externalLink)
Specified by:
makeLink in interface org.axsl.pdf.PdfPage

getContentStream

public PDFContentStream getContentStream()
Specified by:
getContentStream in interface org.axsl.pdf.PdfPage

createDestination

public PDFDestination createDestination(float xPosition,
                                        float yPosition)
Specified by:
createDestination in interface org.axsl.pdf.PdfPage


Copyright © 2017. All rights reserved.