PdfEmbeddedFileSpecification Class
Represents specification of embedded file.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfEmbeddedFileSpecification : PdfFileSpecificationBase, IPdfWrapper
Constructors
PdfEmbeddedFileSpecification(String)
Declaration
public PdfEmbeddedFileSpecification(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | file name |
PdfEmbeddedFileSpecification(String, Byte[])
Declaration
public PdfEmbeddedFileSpecification(string fileName, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Name of the file. |
System.Byte[] | data | The data. |
PdfEmbeddedFileSpecification(String, Stream)
Declaration
public PdfEmbeddedFileSpecification(string fileName, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Name of the file. |
System.IO.Stream | stream | The stream. |
Properties
CreationDate
Gets or sets creation date.
Declaration
public DateTime CreationDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | Creation date. |
Data
Gets or sets the data.
Declaration
public byte[] Data { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] | The data. |
Description
Gets or sets the description.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description. |
FileName
Declaration
public override string FileName { get; set; }
Property Value
Type |
---|
System.String |
Overrides
MimeType
Gets or sets the MIME type of the embedded file.
Declaration
public string MimeType { get; set; }
Property Value
Type | Description |
---|---|
System.String | The MIME type of the embedded file. |
ModificationDate
Gets or sets modification date.
Declaration
public DateTime ModificationDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | Modification date. |
PortfolioAttributes
Gets or sets the Portfolio attributes.
Declaration
public PdfPortfolioAttributes PortfolioAttributes { get; set; }
Property Value
Type |
---|
PdfPortfolioAttributes |
Relationship
Get or set the file relationship
Declaration
public PdfAttachmentRelationship Relationship { get; set; }
Property Value
Type |
---|
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")
Methods
Initialize()
Initializes instance.
Declaration
protected override void Initialize()
Overrides
Save()
Saves object state.
Declaration
protected override void Save()