Class PageObject

All Implemented Interfaces:
Completable, Streamable
Direct Known Subclasses:
Overlay

public class PageObject extends AbstractResourceGroupContainer
Pages contain the data objects that comprise a presentation document. Each page has a set of data objects associated with it. Each page within a document is independent from any other page, and each must establish its own environment parameters. The page is the level in the document component hierarchy that is used for printing or displaying a document's content. The data objects contained in the page envelope in the data stream are presented when the page is presented. Each data object has layout information associated with it that directs the placement and orientation of the data on the page. In addition, each page contains layout information that specifies the measurement units, page width, and page depth. A page is initiated by a begin page structured field and terminated by an end page structured field. Structured fields that define objects and active environment groups or that specify attributes of the page may be encountered in page state.
  • Constructor Details

    • PageObject

      public PageObject(Factory factory, String name, int width, int height, int rotation, int widthRes, int heightRes)
      Construct a new page object for the specified name argument, the page name should be an 8 character identifier.
      Parameters:
      factory - the resource manager
      name - the name of the page.
      width - the width of the page.
      height - the height of the page.
      rotation - the rotation of the page.
      widthRes - the width resolution of the page.
      heightRes - the height resolution of the page.
  • Method Details

    • createIncludePageOverlay

      public void createIncludePageOverlay(String name, int x, int y, int orientation)
      Creates an IncludePageOverlay on the page.
      Parameters:
      name - the name of the overlay
      x - the x position of the overlay
      y - the y position of the overlay
      orientation - the orientation required for the overlay
    • createShading

      public void createShading(int x, int y, int w, int h, int red, int green, int blue)
      This method will create shading on the page using the specified coordinates (the shading contrast is controlled via the red, green blue parameters, by converting this to grayscale).
      Parameters:
      x - the x coordinate of the shading
      y - the y coordinate of the shading
      w - the width of the shaded area
      h - the height of the shaded area
      red - the red value
      green - the green value
      blue - the blue value
    • writeStart

      protected void writeStart(OutputStream os) throws IOException
      Helper method to write the start of the Object.
      Overrides:
      writeStart in class AbstractStructuredObject
      Parameters:
      os - The stream to write to
      Throws:
      IOException - throws an I/O exception if one occurred
    • writeContent

      protected void writeContent(OutputStream os) throws IOException
      Helper method to write the contents of the Object.
      Overrides:
      writeContent in class AbstractPageObject
      Parameters:
      os - The stream to write to
      Throws:
      IOException - throws an I/O exception if one occurred
    • writeEnd

      protected void writeEnd(OutputStream os) throws IOException
      Helper method to write the end of the Object.
      Overrides:
      writeEnd in class AbstractStructuredObject
      Parameters:
      os - The stream to write to
      Throws:
      IOException - an I/O exception if one occurred
    • addObject

      public void addObject(Object obj)
      Adds an AFP object reference to this page
      Overrides:
      addObject in class AbstractPageObject
      Parameters:
      obj - an AFP object
    • toString

      public String toString()
      Overrides:
      toString in class AbstractNamedAFPObject
    • canWrite

      protected boolean canWrite(AbstractAFPObject ao)
      Returns true if this object can be written
      Overrides:
      canWrite in class AbstractResourceGroupContainer
      Parameters:
      ao - an AFP object
      Returns:
      true if this object can be written