List of usage examples for com.itextpdf.text.pdf.parser TextRenderInfo getFont
public DocumentFont getFont()
From source file:DouDownloader.CustomLocationTextExtractionStrategy.java
License:Open Source License
/** * /*from w w w . j av a2s .c o m*/ * @see com.itextpdf.text.pdf.parser.RenderListener#renderText(com.itextpdf.text.pdf.parser.TextRenderInfo) */ public void renderText(TextRenderInfo renderInfo) { LineSegment segment = renderInfo.getBaseline(); if (renderInfo.getRise() != 0) { // remove the rise from the baseline - // we do this because the text from // a // super/subscript render operations // should probably be considered as // part of // the baseline of the text the // super/sub is relative to Matrix riseOffsetTransform = new Matrix(0, -renderInfo.getRise()); segment = segment.transformBy(riseOffsetTransform); } TipoTexto tipo = TipoTexto.NORMAL; if (renderInfo.getFont().getFontDescriptor(DocumentFont.CAPHEIGHT, 1000) > 681) { /* * System.out.println("OPA!!!:-- " + renderInfo.getFont().getFontDescriptor( DocumentFont.CAPHEIGHT, 1000) + " x " + * renderInfo.getText()); */ tipo = TipoTexto.AUTONOMOS; } TextChunk location = new TextChunk(renderInfo.getText(), segment.getStartPoint(), segment.getEndPoint(), renderInfo.getSingleSpaceWidth(), tipo); locationalResult.add(location); }