[]
        
(Showing Draft Content)

C1.C1Pdf.C1PdfDocument.AddAttachment

AddAttachment Method

AddAttachment(string, RectangleF)

Adds a file attachment to the current page.

Declaration
public void AddAttachment(string file, RectangleF rc)
Parameters
Type Name Description
string file

The file that will be included as an attachment.

RectangleF rc

Area of the page that will contain the attachment (in points measured from the top-left corner of the page).

AddAttachment(string, RectangleF, AttachmentIconEnum, Color)

Adds a file attachment to the current page.

Declaration
public void AddAttachment(string file, RectangleF rc, AttachmentIconEnum icon, Color iconColor)
Parameters
Type Name Description
string file

The file that will be included as an attachment.

RectangleF rc

Area of the page that will contain the attachment (in points measured from the top-left corner of the page).

AttachmentIconEnum icon

AttachmentIconEnum value that determines the appearance of the attachment icon.

Color iconColor

Color of the attachment icon.

AddAttachment(string, RectangleF, int, AttachmentIconEnum, Color)

Adds a file attachment to the document.

Declaration
public void AddAttachment(string file, RectangleF rc, int page, AttachmentIconEnum icon, Color iconColor)
Parameters
Type Name Description
string file

The file that will be included as an attachment.

RectangleF rc

Area of the page that will contain the attachment (in points measured from the top-left corner of the page).

int page

Index of the page that contains the attachment.

AttachmentIconEnum icon

AttachmentIconEnum value that determines the appearance of the attachment icon.

Color iconColor

The color of the attachment icon.

Remarks

When the user moves the mouse over an area of the page that contains an attachment, the mouse pointer and tool tip change to indicate that the user can retrieve the attachment. The user can right-click the attachment area to open or save the attachment.

AddAttachment(string, byte[], RectangleF, AttachmentIconEnum, Color)

Adds a stream-based attachment to the current page.

Declaration
public void AddAttachment(string attachmentName, byte[] attachmentData, RectangleF rc, AttachmentIconEnum icon, Color iconColor)
Parameters
Type Name Description
string attachmentName

Name to be shown next to the attachment.

byte[] attachmentData

Byte array containing the attachment data.

RectangleF rc

Area of the page that will contain the attachment (in points measured from the top-left corner of the page).

AttachmentIconEnum icon

AttachmentIconEnum value that determines the appearance of the attachment icon.

Color iconColor

The color of the attachment icon.

Remarks

This override allows you to add attachments containing data that does not come from files. For example, the data could come from blobs or streams stored in a database.

AddAttachment(string, byte[], RectangleF, int, AttachmentIconEnum, Color)

Adds a stream-based attachment to the document.

Declaration
public void AddAttachment(string attachmentName, byte[] attachmentData, RectangleF rc, int page, AttachmentIconEnum icon, Color iconColor)
Parameters
Type Name Description
string attachmentName

Name to be shown next to the attachment.

byte[] attachmentData

Byte array containing the attachment data.

RectangleF rc

Area of the page that will contain the attachment (in points measured from the top-left corner of the page).

int page

Index of the page that contains the attachment.

AttachmentIconEnum icon

AttachmentIconEnum value that determines the appearance of the attachment icon.

Color iconColor

The color of the attachment icon.

Remarks

This override allows you to add attachments containing data that does not come from files. For example, the data could come from blobs or streams stored in a database.