作为 pdfbox 2.0.2 ( https://github.com/apache/pdfbox/tree/2.0.2 ) 用户的新手,我想获取所有描边线(例如,表格的列和行边框)一个页面(PDPage),因此我创建了以下类:package org.apache.pdfbox.rendering;
import java.awt.geom.GeneralPath;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import org.apache.commons.io.IOUtils;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.rendering.PDFRenderer;
import org.apache.pdfbox.rendering.PageDrawer;
import org.apache.pdfbox.rendering.PageDrawerParameters;
public class LineCatcher {
private PageDrawer pageDrawer;
private PDDocument document;
private PDFRenderer pdfRenderer;
private PDPage page;
public LineCatcher(URI pdfSrcURI) throws IllegalArgumentException,
MalformedURLException, IOException {
this.document = PDDocument.load(IOUtils.toByteArray(pdfSrcURI));
this.pdfRenderer = new PDFRenderer(this.document);
}
public GeneralPath getLinePath(int pageIndex) throws IOException {
this.page = this.document.getPage(pageIndex);
PageDrawerParameters parameters = new PageDrawerParameters (this.pdfRenderer, this.page);
this.pageDrawer = new …Run Code Online (Sandbox Code Playgroud) 我尝试在maven项目中使用mrunit测试我的MapReduce 2作业.我从Maven中央仓库搜索并找到了结果:http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.mrunit%22%20AND%20a%3A%22mrunit%22
在上面的链接,最新mrunit 1.1.0有hadoop1.jar和hadoop2.jar,而不是一个罐子链接.正是由于这个原因,当我尝试添加相应的依赖项时
<dependency>
<groupId>org.apache.mrunit</groupId>
<artifactId>mrunit</artifactId>
<version>1.1.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
以pom.xml和运行mvn package,我得到了以下编译错误: Could not find artifact org.apache.mrunit:mrunit:jar:1.1.0 in central (https://repo.maven.apache.org/maven2 ...
任何人都可以帮助解决这个问题吗?提前致谢
我目前正在玩sed来获取两行之间的内容.我有一个很好的教程:http://www.cyberciti.biz/faq/unix-linux-sed-print-only-matching-lines-command/
在本教程中,我发现:
sed -n -e '/regexpA/,/regexpB/p' input.file
Run Code Online (Sandbox Code Playgroud)
上面的命令将同时打印匹配的线条regexpA和regexpB,但我会想逃离这两条线段,说这两个匹配线将无法打印到STDOUT,有没有漂亮的解决方案吗?
提前致谢.
我目前正在从事一个Java项目,我们使用maven来构建最终的jar。众所周知,有两种构建 jar 的方法,即一种带有依赖项的单个 jar 和一种不带依赖项的 jar。在后一种情况下,我们还需要将依赖 jar 添加到类路径中。
原则上两者都可以工作,我个人更喜欢一个带有依赖项的 jar,但在项目团队成员中决定使用单独的没有依赖项的 jar。所以我想知道哪种选择更好?
在我的Debian系统中,我删除/usr/bin/python和/usr/bin/python2.7意外.然后我尝试使用该apt-get remove命令完全删除所有Python 并再次安装它.不幸的是,/usr/bin/python没有像我预期的那样再次创建.
结果,该python命令不能再运行.所以我想恢复/usr/bin/python2.7操作系统级别.
而且,当我重新启动Debian系统时,甚至GNOME GUI也不能再启动了; 只有tty终端8可用,几乎可以肯定是因为没有/usr/bin/python.