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:

ExtensionContent-Type
avivideo/avi
bmpimage/bmp
comapplication/octet-stream
csstext/css
docapplication/msword
exeapplication/octet-stream
gifimage/gif
htmtext/html
htmltext/html
jpgimage/jpeg
jpegimage/jpeg
midaudio/midi
midiaudio/midi
mjpgvideo/x-motion-jpeg
movvideo/quicktime
mp2audio/mpeg
mp3audio/mpeg
mpegvideo/mpeg
mpgvideo/mpeg
pdfapplication/pdf
pngimage/png
pptapplication/mspowerpoint
sgmtext/sgml
sgmltext/sgml
swfapplication/x-shockwave-flash
tarapplication/x-tar
tifimage/tiff
tiffimage/tiff
txttext/plain
wavaudio/wav
wmaaudio/x-ms-wma
wmvaudio/x-ms-wmv
xml"text/xml
zipapplication/x-compressed

If no extension is found the default is application/octet-stream.

Relationship describes the file relationship, e.g. Alternative, Source. Note: this field is used for ZUGFeRD XML invoices.

Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks EDI 2020 JS Edition - Version 20.0 [Build 7941]