Class PdfEmbeddedFileSpecification
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents specification of embedded file.
public class PdfEmbeddedFileSpecification : PdfFileSpecificationBase
- Inheritance
-
PdfEmbeddedFileSpecification
- Derived
- Inherited Members
Constructors
PdfEmbeddedFileSpecification(string)
public PdfEmbeddedFileSpecification(string fileName)
Parameters
fileName
stringfile name
PdfEmbeddedFileSpecification(string, byte[])
public PdfEmbeddedFileSpecification(string fileName, byte[] data)
Parameters
PdfEmbeddedFileSpecification(string, Stream)
public PdfEmbeddedFileSpecification(string fileName, Stream stream)
Parameters
Properties
CreationDate
Gets or sets creation date.
public DateTime CreationDate { get; set; }
Property Value
- DateTime
Creation date.
Data
Gets or sets the data.
public byte[] Data { get; set; }
Property Value
- byte[]
The data.
Description
Gets or sets the description.
public string Description { get; set; }
Property Value
- string
The description.
FileName
public override string FileName { get; set; }
Property Value
MimeType
Gets or sets the MIME type of the embedded file.
public string MimeType { get; set; }
Property Value
- string
The MIME type of the embedded file.
ModificationDate
Gets or sets modification date.
public DateTime ModificationDate { get; set; }
Property Value
- DateTime
Modification date.
PortfolioAttributes
Gets or sets the Portfolio attributes.
public PdfPortfolioAttributes PortfolioAttributes { get; set; }
Property Value
Relationship
Get or set the file relationship
public PdfAttachmentRelationship Relationship { get; set; }
Property Value
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.
protected override void Initialize()
Save()
Saves object state.
protected override void Save()