繁体   English   中英

解析 Pdf 以获取 Objective-c 中 pdf 页面中的图像边界

[英]Parse Pdf to get the boudaries of image in the pdf page in Objective-c

I have an iPad app that displays pdf pages.I need to add annotations on the image (if exists on the pdf page) for which i need the coordinates at which the image is situated in the pdf page.I am able to get the image来自 XObject 和图像宽度和高度的数据,但我还需要图像的 x 和 y 坐标。关于如何通过解析 pdf 页面获取图像坐标的任何想法?

我假设您已经看到这个描述如何解析 XObjects 的苹果开发人员页面: http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf_scan/dq_pdf_scan.ZFC35FDC70D5FC69D269883A822C7A

XObject 不包含任何 position 数据,因为它们仅描述可通过 pdf 重复使用的图像数据。

来自http://itext-general.2136553.n4.nabble.com/finding-the-position-of-xobject-in-an-existing-pdf-td2157152.html

“一个 XObject 是一个 stream 可以在许多不同的其他流中重用。例如:您可以有一个徽标的图像 XObject 出现在文档的每一页上。假设您有一些横向页面和一些纵向页面。那么logo在这些不同的页面上会有不同的坐标。所以XObject的position NEVER STORED with the XObject,position可以在ZF7B44CFAFD5C52223D5498196C52223D5498196C8A2EZ中找到,那么你的反应是:“哦,那是指XObject。”简单:我必须查看使用 XObject 的页面的内容 ZF7B44CFFAFD5C52223D5498196C8A2E7BZ。“是的,也不是。这确实是你应该看的地方,但它并不简单。因为实际的 position 取决于当前 Z9EDEZ9E2EA93412EF576B 的转换矩阵图像已添加。pars 的编程工作相当多 e 内容 stream 并计算 XObject 的 position。 "

我认为您应该找到另一种选择,并一起避免这种情况。

如果您仍然确定您将不得不使用 CGPDFScanner 并通过页面查找转换。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM