Attachment Event
Fired when an attachment is found.
Syntax
public event OnAttachmentHandler OnAttachment; public delegate void OnAttachmentHandler(object sender, PdfxmlAttachmentEventArgs e); public class PdfxmlAttachmentEventArgs : EventArgs { public string Name { get; } public string ContentType { get; } public string Relationship { get; } }
Public Event OnAttachment As OnAttachmentHandler Public Delegate Sub OnAttachmentHandler(sender As Object, e As PdfxmlAttachmentEventArgs) Public Class PdfxmlAttachmentEventArgs Inherits EventArgs Public ReadOnly Property Name As String Public ReadOnly Property ContentType As String Public ReadOnly Property Relationship As String End Class
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.