com.teamdev.jxdocument
Class Page

java.lang.Object
  extended by com.teamdev.jxdocument.Page

public class Page
extends java.lang.Object

Represents a page inside PDF document. When you don't need Page instance anymore make sure that you close it using close() method, otherwise you can see memory leak.


Method Summary
 void close()
          Closes the current page and releases all its resources and allocated memory.
 java.awt.Image convertToImage(int imageWidth, int imageHeight)
          Renders page into an image with specified width and height in pixels.
 java.awt.Dimension getSize()
          Returns page size in pixels.
 Text getText()
          Returns text representation of the page.
 boolean isClosed()
          Returns true when the current page was closed via close() method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSize

public java.awt.Dimension getSize()
Returns page size in pixels.

Returns:
page size in pixels.
Throws:
java.lang.IllegalStateException - when page is closed.

getText

public Text getText()
Returns text representation of the page.

Returns:
text representation of the page.
Throws:
java.lang.IllegalStateException - when error occurs during page load; when page is closed.

convertToImage

public java.awt.Image convertToImage(int imageWidth,
                                     int imageHeight)
Renders page into an image with specified width and height in pixels. The page will be scaled and drawn onto return image. To get page size in pixels see the getSize() method.

On Retina displays this method returns an image which is twice bigger than passed width and height parameters.

Parameters:
imageWidth - required image width in pixels.
imageHeight - required image height in pixels.
Returns:
an image of the current page.
Throws:
java.lang.IllegalStateException - when page is closed.

isClosed

public boolean isClosed()
Returns true when the current page was closed via close() method.

Returns:
true when the current page was closed via close() method.

close

public void close()
Closes the current page and releases all its resources and allocated memory. When page is closed you cannot access its size, text, and convert it to the image. To check whether the current page is already closed see isClosed() method.