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:

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 .NET Edition - Version 20.0 [Build 7941]