0

I'm attaching files to a pdf with XEP and xsl-fo:

<fo:block><rx:pdf-comment xmlns:rx="http://www.renderx.com/XSL/Extensions" content="" title="sample.bmp">
<rx:pdf-file-attachment filename="sample.bmp" src="url(data:image/bmp;base64,Qk02BFEAAA....)"/>
</rx:pdf-comment></fo:block>

It works and shows up on the Attachments page. A visible mark of any kind at the position where the file is embedded is not needed - but:

I would like to also have a fo:basic-link or alike at some text in the document so that clicking that in Acrobat will prompt the open dialog for the embedded file. It seems that neither pdf-file-attachment nor pdf-comment can have text content, so placing the embedded file at the position where I want the link seems not an option, and would also allow only one link to the file. Apache Fop has the probably proprietary url(embedded-file( syntax for that, is there something simlar in XEP?

Stefan Hegny
  • 2,107
  • 4
  • 23
  • 26
  • You could probably use Javascript to do it since RenderX also supports embedding Javascript into the document. This solution would only work on PDF viewers that support Javascript though and many do not. – Kevin Brown Apr 19 '19 at 18:29
  • 1
    I have done a bit of testing and you can attach something like this to MouseUp or other ... this.exportDataObject({cName: "attach.pdf", nLaunch: 1}); Where "attach.pdf" is your attached file. – Kevin Brown Apr 19 '19 at 18:37
  • One note, I would guess you would need to have licensed PDF AcroForm support from RenderX to do this. Javascript like this can only be attached to AcroForm filed objects (like a button) and that requires this option in RenderX, – Kevin Brown Apr 19 '19 at 20:03

0 Answers0