0

i use this code below to parse a PDF file and extract three different types of URI's/data.

1) Normal URL

2) Anchor within the PDF

3) A file link example "../other.pdf"

See Code here: http://pastebin.com/LMJtVGZw

--

Due to a user requirement i create a PDF file within my application and i need to insert the three mentioned types of URI's/data.

1) Normal URL can be created with these lines of code

http://pastebin.com/HdetkSvT

2) Anchor, this code doen't work and i'm not able to parse it (See case #2 above) http://pastebin.com/DfZwsK33

3) A file link example "../other.pdf"

I have no idea :-(

I hope someone can help me to get #2 and #3 working.

Thank you guys!

4

1 回答 1

0

对于第二部分,您粘贴的代码仅包含CGPDFContextAddDestinationAtPoint

定义锚点的代码。这实际上不会在 PDF 文件中生成任何内容(它与 HTML 不同,其中锚点存在于 HTML 代码中的某处)。

您是否还用于CGPDFContextSetDestinationForRect设置实际的链接注释?这是应该在文件中生成实际 PDF 对象的那个...

于 2012-11-27T19:29:24.933 回答