Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfAttachmentRelationship

    Show / Hide Table of Contents

    Class PdfAttachmentRelationship

    Specifies the file relationship of attachment.

    Inheritance
    System.Object
    PdfAttachmentRelationship
    Namespace: Syncfusion.Pdf
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public sealed class PdfAttachmentRelationship : Enum
    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

    Alternative

    Alternative representation of the PDF contents

    Declaration
    public const PdfAttachmentRelationship Alternative
    Field Value
    Type Description
    PdfAttachmentRelationship

    Data

    Represents information used to derive a visual presentation

    Declaration
    public const PdfAttachmentRelationship Data
    Field Value
    Type Description
    PdfAttachmentRelationship

    Source

    The original source material for the associated content

    Declaration
    public const PdfAttachmentRelationship Source
    Field Value
    Type Description
    PdfAttachmentRelationship

    Supplement

    supplemental representation of the original source or data that may be more easily consumable

    Declaration
    public const PdfAttachmentRelationship Supplement
    Field Value
    Type Description
    PdfAttachmentRelationship

    Unspecified

    Relationship is not known or cannot be described using one of the other values

    Declaration
    public const PdfAttachmentRelationship Unspecified
    Field Value
    Type Description
    PdfAttachmentRelationship

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved