com.itextpdf.text.pdf.parser
Class TextMarginFinder

java.lang.Object
  extended by com.itextpdf.text.pdf.parser.TextMarginFinder
All Implemented Interfaces:
RenderListener

public class TextMarginFinder
extends Object
implements RenderListener

Allows you to find the rectangle that contains all the text in a page.

Since:
5.0.2

Constructor Summary
TextMarginFinder()
           
 
Method Summary
 void beginTextBlock()
          Called when a new text block is beginning (i.e.
 void endTextBlock()
          Called when a text block has ended (i.e.
 float getHeight()
          Gets the height of the text block.
 float getLlx()
          Getter for the left margin.
 float getLly()
          Getter for the bottom margin.
 float getUrx()
          Getter for the right margin.
 float getUry()
          Getter for the top margin.
 float getWidth()
          Gets the width of the text block.
 void renderImage(ImageRenderInfo renderInfo)
          Called when image should be rendered
 void renderText(TextRenderInfo renderInfo)
          Method invokes by the PdfContentStreamProcessor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextMarginFinder

public TextMarginFinder()
Method Detail

renderText

public void renderText(TextRenderInfo renderInfo)
Method invokes by the PdfContentStreamProcessor. Passes a TextRenderInfo for every text chunk that is encountered. We'll use this object to obtain coordinates.

Specified by:
renderText in interface RenderListener
Parameters:
renderInfo - information specifying what to render
See Also:
RenderListener.renderText(com.itextpdf.text.pdf.parser.TextRenderInfo)

getLlx

public float getLlx()
Getter for the left margin.

Returns:
the X position of the left margin

getLly

public float getLly()
Getter for the bottom margin.

Returns:
the Y position of the bottom margin

getUrx

public float getUrx()
Getter for the right margin.

Returns:
the X position of the right margin

getUry

public float getUry()
Getter for the top margin.

Returns:
the Y position of the top margin

getWidth

public float getWidth()
Gets the width of the text block.

Returns:
a width

getHeight

public float getHeight()
Gets the height of the text block.

Returns:
a height

beginTextBlock

public void beginTextBlock()
Description copied from interface: RenderListener
Called when a new text block is beginning (i.e. BT)

Specified by:
beginTextBlock in interface RenderListener
See Also:
RenderListener.beginTextBlock()

endTextBlock

public void endTextBlock()
Description copied from interface: RenderListener
Called when a text block has ended (i.e. ET)

Specified by:
endTextBlock in interface RenderListener
See Also:
RenderListener.endTextBlock()

renderImage

public void renderImage(ImageRenderInfo renderInfo)
Description copied from interface: RenderListener
Called when image should be rendered

Specified by:
renderImage in interface RenderListener
Parameters:
renderInfo - information specifying what to render
See Also:
RenderListener.renderImage(com.itextpdf.text.pdf.parser.ImageRenderInfo)


Copyright © 2013. All Rights Reserved.