Package com.itextpdf.text.pdf.parser
Class TextMarginFinder
java.lang.Object
com.itextpdf.text.pdf.parser.TextMarginFinder
- All Implemented Interfaces:
RenderListener
Allows you to find the rectangle that contains all the text in a page.
- Since:
- 5.0.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a new text block is beginning (i.e.voidCalled when a text block has ended (i.e.floatGets the height of the text block.floatgetLlx()Getter for the left margin.floatgetLly()Getter for the bottom margin.floatgetUrx()Getter for the right margin.floatgetUry()Getter for the top margin.floatgetWidth()Gets the width of the text block.voidrenderImage(ImageRenderInfo renderInfo) Called when image should be renderedvoidrenderText(TextRenderInfo renderInfo) Method invokes by the PdfContentStreamProcessor.
-
Field Details
-
textRectangle
-
-
Constructor Details
-
TextMarginFinder
public TextMarginFinder()
-
-
Method Details
-
renderText
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:
renderTextin interfaceRenderListener- Parameters:
renderInfo- information specifying what to render- See Also:
-
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:RenderListenerCalled when a new text block is beginning (i.e. BT)- Specified by:
beginTextBlockin interfaceRenderListener- See Also:
-
endTextBlock
public void endTextBlock()Description copied from interface:RenderListenerCalled when a text block has ended (i.e. ET)- Specified by:
endTextBlockin interfaceRenderListener- See Also:
-
renderImage
Description copied from interface:RenderListenerCalled when image should be rendered- Specified by:
renderImagein interfaceRenderListener- Parameters:
renderInfo- information specifying what to render- See Also:
-