Attachment Event
Fired when an attachment is found.
Syntax
pdfxml.on('Attachment', listener: (e: {readonly name: string, readonly contentType: string, readonly relationship: string}) => void )
Remarks
This event will fire for each attachment found in a PDF after calling the Load method.
Name is the name of the attachment.
ContentType describes the attachment content.
File extensions are mapped to the following Content-Type:
Extension | Content-Type |
avi | video/avi |
bmp | image/bmp |
com | application/octet-stream |
css | text/css |
doc | application/msword |
exe | application/octet-stream |
gif | image/gif |
htm | text/html |
html | text/html |
jpg | image/jpeg |
jpeg | image/jpeg |
mid | audio/midi |
midi | audio/midi |
mjpg | video/x-motion-jpeg |
mov | video/quicktime |
mp2 | audio/mpeg |
mp3 | audio/mpeg |
mpeg | video/mpeg |
mpg | video/mpeg |
application/pdf | |
png | image/png |
ppt | application/mspowerpoint |
sgm | text/sgml |
sgml | text/sgml |
swf | application/x-shockwave-flash |
tar | application/x-tar |
tif | image/tiff |
tiff | image/tiff |
txt | text/plain |
wav | audio/wav |
wma | audio/x-ms-wma |
wmv | audio/x-ms-wmv |
xml | "text/xml |
zip | application/x-compressed |
Relationship describes the file relationship, e.g. Alternative, Source. Note: this field is used for ZUGFeRD XML invoices.