Anchor link to document attachment
How can I set a reference or an iText anchor to an attachment on my document using iText?
If you want an Anchor to open any type of attachment: forget about it, ISO-32000-1 (that's the PDF reference in case you didn't know) doesn't support it. If you want an Anchor to open a PDF attachment: use a GoToE annotation. I quote section 22.214.171.124 of ISO-32000-1:
An embedded go-to action (PDF 1.6) is similar to a remote go-to action but allows jumping to or from a PDF file that is embedded in another PDF file. Embedded files may be associated with file attachment annotations or with entries in the EmbeddedFiles name tree.
In iText, the PdfAction class has different gotoEmbedded() methods. Read p538 of iText in Action - Second Edition to find out how to use these methods.