我需要得到的直角坐标的注释使用冰pdf查看器。有什么办法可以做到这一点吗?
发布于 2015-04-20 18:02:15
org.icepdf.ri.common.tools.SquareAnnotationHandler类处理所有鼠标事件和用于创建Square注解的绘图。这是扩展或使用它作为参考的一个很好的起点。
将消息对话框添加到mouseReleased下
JOptionPane.showMessageDialog(null, "Rectangle coordinates x ---> "+rectToDraw.x+" y --> "+ rectToDraw.y+" Width --> "+ rectToDraw.width+" height --> "+ rectToDraw.height);发布于 2016-07-20 04:02:07
如果有人还在寻找答案。
Icepdf的Annotation类包含这些坐标。可以像这样检索它们:
Rectangle2D.Float box = annotation.getUserSpaceRectangle();
Map<String, Double> bounds = new HashMap<String, Double>();
bounds.put("height", box.getHeight());
bounds.put("width", box.getWidth());
bounds.put("x", box.getX());
bounds.put("y", box.getY());https://stackoverflow.com/questions/29744738
复制相似问题