itextsharp: getting coordinates of image

戏子无情 提交于 2019-12-24 20:12:59

问题


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???????

回答1:


If you're trying to get this info while you are building the PDF document:

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.

If you're trying to get this info from an already-created and saved PDF file:

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



来源:https://stackoverflow.com/questions/1911235/itextsharp-getting-coordinates-of-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!