使用C#使用Pdfbox提取Area pdf文件 [英] Extract Area a pdf file with Pdfbox using C#
本文介绍了使用C#使用Pdfbox提取Area pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PDDocument doc = PDDocument.load(pdf_in);
PDFTextStripper pdfstripper = 新 PDFTextStripper();
PDFTextStripperByArea stripperArea = 新 PDFTextStripperByArea();
stripperArea.setSortByPosition( true );
Rectangle rect = 新 Rectangle( 10 , 280 , 275 , 60 );
stripperArea.addRegion(" ,rect);
.....
我有问题:
错误:org.pdfbox.util.PDFTextStripperByArea.addRegion(string,java.awt.geom.Rectangle2D)的最佳重载方法匹配具有无效参数.
请帮帮我.
解决方案
错误说明了一切,只是创建一个Rectangle2D
对象而不是Rectangle
.
>
PDDocument doc = PDDocument.load(pdf_in);
PDFTextStripper pdfstripper = new PDFTextStripper();
PDFTextStripperByArea stripperArea = new PDFTextStripperByArea();
stripperArea.setSortByPosition(true);
Rectangle rect = new Rectangle(10,280,275,60);
stripperArea.addRegion("class1",rect);
.....
I have a problem :
Error:The best overloaded method match for org.pdfbox.util.PDFTextStripperByArea.addRegion(string, java.awt.geom.Rectangle2D)' has some invalid arguments .
Please help me.
解决方案
The error say it all, just create aRectangle2D
object instead ofRectangle
.
这篇关于使用C#使用Pdfbox提取Area pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文