Vector 用pdfclown提取矢量图形(直线和点)

Vector 用pdfclown提取矢量图形(直线和点),vector,graphics,pdfclown,Vector,Graphics,Pdfclown,我想用pdfclown从pdf中提取矢量图形(线和点)。我试着围绕着图形示例进行思考,但我无法理解对象模型是如何实现这一点的。有人能解释一下这种关系吗?你说得对:在PDF小丑0.1系列之前,高级路径建模还没有实现(它可能是从中派生出来的) 下一个版本(将于下个月发布)将通过新版本支持所有图形内容的高级表示,包括路径对象(PathElement)。以下是一个例子: import org.pdfclown.documents.contents.elements.ContentModeller; im

我想用pdfclown从pdf中提取矢量图形(线和点)。我试着围绕着图形示例进行思考,但我无法理解对象模型是如何实现这一点的。有人能解释一下这种关系吗?

你说得对:在PDF小丑0.1系列之前,高级路径建模还没有实现(它可能是从中派生出来的)

下一个版本(将于下个月发布)将通过新版本支持所有图形内容的高级表示,包括路径对象(PathElement)。以下是一个例子:

import org.pdfclown.documents.contents.elements.ContentModeller;
import org.pdfclown.documents.contents.elements.GraphicsElement;
import org.pdfclown.documents.contents.elements.PathElement;
import org.pdfclown.documents.contents.objects.Path;

import java.awt.geom.GeneralPath;

for(GraphicsElement<?> element : ContentModeller.model(page, Path.class))
{
  PathElement pathElement = (PathElement)element;
  List<ContentMarker> markers = pathElement.getMarkers();
  pathElement.getBox();
  GeneralPath getPath = pathElement.getPath();
  pathElement.isFilled();
  pathElement.isStroked();
}
import org.pdfclown.documents.contents.elements.ContentModeler;
导入org.pdfclown.documents.contents.elements.GraphicsElement;
导入org.pdfclown.documents.contents.elements.PathElement;
导入org.pdfclown.documents.contents.objects.Path;
导入java.awt.geom.GeneralPath;
for(GraphicsElement元素:contentmodeler.model(page,Path.class))
{
PathElement路径元素=(PathElement)元素;
List markers=pathElement.getMarkers();
getBox();
GeneralPath getPath=pathElement.getPath();
pathElement.isFilled();
pathElement.isStroked();
}

同时,您可以按照ContentScanningSample(可下载发行版中提供)中的建议,提取迭代内容流的矢量图形的低级表示形式,查找路径相关操作(、、…).

我投票结束这个问题,因为它没有询问关于现有代码的特定问题。这只是要求人们解释一下第三方图书馆。谢谢。非常有建设性的回答。我像孩子一样在圣诞节等待新版本的发布!Stefano,0.2系列尚未发布,但您显然已经在2015年为其编写了大量代码并实现了大量功能。即使没有完全抛光,你也会考虑出版吗?