org.foray.pdf.object
Class PDFPages

java.lang.Object
  extended by org.foray.pdf.object.PDFObject
      extended by org.foray.pdf.object.PDFPages

public class PDFPages
extends PDFObject

class representing a /Pages object. A /Pages object is an ordered collection of pages (/Page objects) (Actually, /Pages can contain further /Pages as well but this implementation doesn't allow this)


Field Summary
 
Fields inherited from class org.foray.pdf.object.PDFObject
EOL, MSG_EOL, XREF_EOL
 
Constructor Summary
PDFPages(PDFDocument doc)
          Create a /Pages object.
 
Method Summary
 void addPage(PDFPage page)
          add a /Page object.
 int getCount()
          Get the count of /Page objects.
 void incrementCount()
          Increment the count of /Page objects.
 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

PDFPages

public PDFPages(PDFDocument doc)
Create a /Pages object. NOTE: The PDFPages object must be created before the PDF document is generated, but it is not written to the stream immediately. It must aslo be allocated an object ID (so that the kids can refer to the parent) so that the XRef table needs to be updated before this object is written.

Parameters:
doc - The PDF document being built.
Method Detail

addPage

public void addPage(PDFPage page)
add a /Page object.

Parameters:
page - the PDFPage to add.

getCount

public int getCount()
Get the count of /Page objects.

Returns:
the number of pages

incrementCount

public void incrementCount()
Increment the count of /Page objects.


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.


Copyright © 2017. All rights reserved.