I have successfully parsed a XML file into a XHTML file, and then finally into a PDF using iText.
Now the next achievement would be to attach and link the Base64 embedded documents from the XML file into the PDF document. Attaching these files (so they appear in the "attachments pane" in the PDF viewer) is working.
Now my problem is that these attachments (.doc, .ppt, etc) should be opened by clicking on a text link or an image (icon). The images (and document names e.g. "test.doc") are already in the PDF, but how can I link the right file to the right image or text link? Could some of you give me a hint where to start?
What you could do is create a "mapping" of those files to the names, so they will have a unique identifier. After that you just create an endpoint that will return required file with required mime type (check out Octet stream as well). In the PDF you just add the hyperlinks that will go to your endpoint and fetch the required document by name.
EDIT: You could actually have more than one endpoint: you could need one for every mime type you use for more convenience.
In order to create a link inside PDF, use Anchor from iText lib.
In order to create an endpoint - it is really up to you. You can use any way to create a webapp that would return a file from web interactively.