itextsharp:获取图像的坐标 [英] itextsharp: getting coordinates of image

查看:414
本文介绍了itextsharp:获取图像的坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在vb.net中可以获取图像的坐标,就像我做了一样

in vb.net is it possible to get the coordinates of an image like if i do a

document.add (jpeg_image)
x_coordinate = jpeg_image.xcoordinate???????


推荐答案

如果你想得到这个构建PDF文档时的信息:

图像左边缘的x坐标取决于图像添加到PDF的方式文献。如果您使用绝对位置来添加它,您将拥有x坐标。如果你只是添加它,没有绝对位置,或任何其他修饰符,x坐标将等于左边距是什么,因为这是默认值。如果您已指定图像应居中或左对齐,则您需要使用图像宽度和边距来计算图像左边缘的位置。

The x-coordinate of the left edge of your image will depend on how the image was added to the PDF document. If you use an absolute position to add it, you'll have your x-coordinate. If you just add it, without absolute position, or any other modifiers, the x-coordinate will be equal to whatever the left margin is, since that is the default. If you've specified that the image should be centered or left-justified, then you'll need your image width and your margins to figure the location of the left edge of the image.

如果您尝试从已创建和保存的PDF文件中获取此信息:

周杰伦是对的,那里在iTextSharp中没有方法可以做到这一点。

Jay is right, there is no method in iTextSharp to do this.

这篇关于itextsharp:获取图像的坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆