/** * Returns the physical page format for the given position. * * @param pos * the position in the page grid. * @return a clone of the pageformat at the specified positon. */ public PageFormat getPageFormat( final int pos ) { if ( pos < 0 || pos > getPageCount() ) { throw new IndexOutOfBoundsException( "Index is invalid" ); } return (PageFormat) format.clone(); }
/** * Returns the printable area within the logical page area covered by the physical page at the given position. * * @param index * the positon. * @return the printable area for the page. */ public Rectangle2D getPagePosition( final int index ) { if ( index < 0 || index > getPageCount() ) { throw new IndexOutOfBoundsException( "Index is invalid" ); } return pagePositions[index].getBounds2D(); }