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!

Nathaniel Waisbrot
  • 23,261
  • 7
  • 71
  • 99
user547064
  • 217
  • 1
  • 4
  • 14

1 Answers1

0

For the second part, your pasted code contains only the CGPDFContextAddDestinationAtPoint

code where you define the anchor. This will actually not generate anything in the PDF file (it's not like HTML where the anchor is something that is present in the HTML code somewhere).

Did you also use CGPDFContextSetDestinationForRect to setup the actual link annotation? This is the one that should generate the actual PDF objects in the file...

David van Driessche
  • 6,602
  • 2
  • 28
  • 41