簡體   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