PdfFileAttachmentAnnotation Class

Represents a file attachment displayed as a clickable icon on a specific page of the PDF. Clicking the icon opens or extracts the attached file. The file is also added to the Attachments panel alongside any other attachments. Use one of the static factory methods (FromBytes(Byte, String, Int32, Int32, Int32), FromFile(String, Int32, Int32, Int32), FromExternalPath(String, Int32, Int32, Int32), FromUrl(String, Int32, Int32, Int32)) to create an instance, then pass it to AddFileAttachmentAnnotation on the document, editor, merger, or HTML-to-PDF options

Definition

Namespace: HiQPdf.Next
Assembly: HiQPdf.Next (in HiQPdf.Next.dll) Version: 18.9.2
C#
public class PdfFileAttachmentAnnotation
Inheritance
Object    PdfFileAttachmentAnnotation

Properties

AddToAttachmentsPanel When true, also adds the file to the document-level /Names /EmbeddedFiles tree, producing a separate entry in the viewer's Attachments panel alongside the page annotation. Default is false
Description Optional description displayed in the Attachments panel
FileName File name shown in the Attachments panel, including extension (for example, "invoice.xml"). Ignored for URL attachments
Height Height of the icon, in points. Default is 24
Icon Icon used for the attachment annotation. Default is Paperclip
MimeType Optional MIME type of the file (for example, "application/xml")
PageNumber 1-based page number on which the attachment icon is placed
Relationship Relationship between the attached file and the PDF document. Required for PDF/A-3 and PDF/A-4f compliance, ignored for other standards. Default is Unspecified
TooltipText Tooltip shown when the mouse hovers over the icon
Width Width of the icon, in points. Default is 24
X The X coordinate of the annotation icon's top-left corner, in points, measured from the left edge of the page content area
Y The Y coordinate of the annotation icon's top-left corner, in points, measured from the top of the page content area

Methods

Equals
(Inherited from Object)
Finalize
(Inherited from Object)
FromBytes Creates an attachment annotation from a byte array. The file content is embedded in the PDF and an icon is placed on the specified page
FromExternalPath Creates an attachment annotation that references an external file by path. The file is NOT embedded; the reference depends on the PDF reader being able to access the same path
FromFile Creates an attachment annotation from a file on disk. The file is read, embedded in the PDF, and an icon is placed on the specified page
FromUrl Creates an attachment annotation that references a URL. Clicking the icon opens the URL in the default browser
GetHashCode
(Inherited from Object)
GetType
(Inherited from Object)
MemberwiseClone
(Inherited from Object)
ToString
(Inherited from Object)

See Also