Enum PdfAttachmentRelationship
Specifies the file relationship of attachment.
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public enum PdfAttachmentRelationship
Examples
//Creates a new PDF document.
PdfDocument doc = new PdfDocument(PdfConformanceLevel.Pdf_A3B);
//Add a page.
PdfPage page = doc.Pages.Add();
//Set the ZugferdProfile.
doc.ZugferdConformanceLevel = ZugferdConformanceLevel.Basic;
//Create the PdfTrueTypeFont
PdfFont font = new PdfTrueTypeFont(new Font("arial", 12f, FontStyle.Regular), true);
page.Graphics.DrawString("Hello World", font, PdfBrushes.Black, PointF.Empty);
//Creates an attachment
PdfAttachment attachment = new PdfAttachment("ZUGFeRD-invoice.xml");
//Set the file relationship
attachment.Relationship = PdfAttachmentRelationship.Alternative;
attachment.ModificationDate = DateTime.Now;
attachment.Description = "About Syncfusion";
attachment.MimeType = "application/xml";
//add attachment to the doucment
doc.Attachments.Add(attachment);
doc.Save("output.pdf");
'Creates a new PDF document.
Dim doc As New PdfDocument(PdfConformanceLevel.Pdf_A3B)
'Add a page.
Dim page As PdfPage = doc.Pages.Add()
'Set the ZugferdProfile.
doc.ZugferdConformanceLevel = ZugferdConformanceLevel.Basic
'Create the PdfTrueTypeFont
Dim font As PdfFont = New PdfTrueTypeFont(New Font("arial", 12F, FontStyle.Regular), True)
page.Graphics.DrawString("Hello World", font, PdfBrushes.Black, PointF.Empty)
'Creates an attachment
Dim attachment As New PdfAttachment("ZUGFeRD-invoice.xml")
'Set the file relationship
attachment.Relationship = PdfAttachmentRelationship.Alternative
attachment.ModificationDate = DateTime.Now
attachment.Description = "About Syncfusion"
attachment.MimeType = "application/xml"
'add attachment to the doucment
doc.Attachments.Add(attachment)
doc.Save("output.pdf")
Fields
Name | Description |
---|---|
Alternative | Alternative representation of the PDF contents |
Data | Represents information used to derive a visual presentation |
Source | The original source material for the associated content |
Supplement | supplemental representation of the original source or data that may be more easily consumable |
Unspecified | Relationship is not known or cannot be described using one of the other values |