<< back
PD4ML: PDF Attachments
PD4ML allows you to embed attachments to a resulting PDF file with a proprietary
<pd4ml:attachment> tag. In the simplest scenarios the tag defines a
clickable icon (from the standard PDF attachment icons set) and provides a
description.
<pd4ml:attachment src="http://old.pd4ml.com/i/logo.png"
description="attachment sample" icon="Paperclip"/>
There are 4 available icons, predefined by PDF specification: "Paperclip",
"PushPin", "Graph" and "Tag"
Alternatively it is possible not define any icon, but a clickable area.
<pd4ml:attachment src="file:o:/work/DXL.pdf"
description="attachment sample"
icon="Area" height=18 width=108/> <font color=blue><u>Clickable area</u></font>
What is behind the area - is up to you. In the example above it is a line of text.
For a precise definition of a clickable area, you may temporarily highlight it
(the border will be visible in PD4Browser GUI application in preview mode):
<pd4ml:attachment src="../extreme-2.swf"
description="attachment sample"
icon="Area" height=18 width=108
style="border: 1 solid tomato"/> ...
Sometimes there is a need to define an attachment inline, without a referring
to an external file. It could be done with base64-encoded attachment body
like that:
<pd4ml:attachment description="attached.txt" icon="PushPin">
data:base64,YSxiLGMsZCxlDQp2YWx1ZSAxLCB2YWx1ZSAyLCB2YWx1ZSAzLCB2YWx1ZSA0
</pd4ml:attachment>
Note: description attribute in the case should hint PDF viewer regarding the attachment type (using a file extension).
|