Java 类com.itextpdf.text.pdf.parser.ImageRenderInfo 实例源码

项目:testarea-itext5    文件:MarginFinder.java   
/**
 * @see RenderListener#renderImage(ImageRenderInfo)
 */
public void renderImage(ImageRenderInfo renderInfo)
{
    Matrix imageCtm = renderInfo.getImageCTM();
    Vector a = new Vector(0, 0, 1).cross(imageCtm);
    Vector b = new Vector(1, 0, 1).cross(imageCtm);
    Vector c = new Vector(0, 1, 1).cross(imageCtm);
    Vector d = new Vector(1, 1, 1).cross(imageCtm);
    LineSegment bottom = new LineSegment(a, b);
    LineSegment top = new LineSegment(c, d);
    if (textRectangle == null)
        textRectangle = bottom.getBoundingRectange();
    else
        textRectangle.add(bottom.getBoundingRectange());

    textRectangle.add(top.getBoundingRectange());
}
项目:testarea-itext5    文件:FreeSpaceFinder.java   
@Override
public void renderImage(ImageRenderInfo renderInfo)
{
    Matrix imageMatrix = renderInfo.getImageCTM();

    Vector image00 = rect00.cross(imageMatrix);
    Vector image01 = rect01.cross(imageMatrix);
    Vector image10 = rect10.cross(imageMatrix);
    Vector image11 = rect11.cross(imageMatrix);

    Rectangle2D usedSpace = new Rectangle2D.Float(image00.get(Vector.I1), image00.get(Vector.I2), 0, 0);
    usedSpace.add(image01.get(Vector.I1), image01.get(Vector.I2));
    usedSpace.add(image10.get(Vector.I1), image10.get(Vector.I2));
    usedSpace.add(image11.get(Vector.I1), image11.get(Vector.I2));

    remove(usedSpace);
}
项目:spring-itext    文件:MicaiItextUtils.java   
public static float[] getKeyWords(String filePath) {
    try {
        PdfReader pdfReader = new PdfReader(filePath);
        int pageNum = pdfReader.getNumberOfPages();
        PdfReaderContentParser pdfReaderContentParser = new PdfReaderContentParser(pdfReader);
        // 下标从1开始
        for (i = 1; i <= pageNum; i++) {
            pdfReaderContentParser.processContent(i, new RenderListener() {
                public void renderText(TextRenderInfo textRenderInfo) {
                    String text = textRenderInfo.getText();
                    System.out.println(i + ":" +text);
                    if (null != text && text.contains(KEY_WORD)) {
                        Float boundingRectange = textRenderInfo.getBaseline().getBoundingRectange();
                        resu = new float[3];
                        resu[0] = boundingRectange.x;
                        resu[1] = boundingRectange.y;
                        resu[2] = i;
                    }
                }
                public void renderImage(ImageRenderInfo arg0) {

                }
                public void endTextBlock() {

                }
                public void beginTextBlock() {

                }
            });
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return resu;
}
项目:testarea-itext5    文件:PageVerticalAnalyzer.java   
@Override
public void renderImage(ImageRenderInfo renderInfo)
{
    Matrix ctm = renderInfo.getImageCTM();
    float[] yCoords = new float[4];
    for (int x=0; x < 2; x++)
        for (int y=0; y < 2; y++)
        {
            Vector corner = new Vector(x, y, 1).cross(ctm);
            yCoords[2*x+y] = corner.get(Vector.I2);
        }
    Arrays.sort(yCoords);
    addVerticalUseSection(yCoords[0], yCoords[3]);
}
项目:finances    文件:TextExtractor.java   
@Override
public void renderImage(ImageRenderInfo info) {
}
项目:testarea-itext5    文件:PdfContentStreamEditor.java   
@Override
public void renderImage(ImageRenderInfo renderInfo) { }
项目:testarea-itext5    文件:TextLineFinder.java   
@Override
public void renderImage(ImageRenderInfo renderInfo) { }
项目:testarea-itext5    文件:CertifiedSchoolListExtractionStrategy.java   
@Override
public void renderImage(ImageRenderInfo renderInfo) { }
项目:testarea-itext5    文件:CheckBoxExtractionStrategy.java   
@Override
public void renderImage(ImageRenderInfo arg0) { }
项目:testarea-itext5    文件:RemappingExtractionFilter.java   
@Override
public void renderImage(ImageRenderInfo renderInfo)
{
    strategy.renderImage(renderInfo);
}
项目:testarea-itext5    文件:LayoutTextExtractionStrategy.java   
/**
 * no-op method - this renderer isn't interested in image events
 * @see com.itextpdf.text.pdf.parser.RenderListener#renderImage(com.itextpdf.text.pdf.parser.ImageRenderInfo)
 * @since 5.0.1
 */
public void renderImage(ImageRenderInfo renderInfo) {
    // do nothing
}
项目:gutenberg    文件:TextStripper.java   
/**
 * @see com.itextpdf.text.pdf.parser.RenderListener#renderImage(
 *com.itextpdf.text.pdf.parser.ImageRenderInfo)
 */
public void renderImage(ImageRenderInfo renderInfo) {
}