PdfFileAttachment Class

Represents a file attached to a PDF document. The attachment is added to the document's Attachments panel in PDF viewers. To also display a clickable icon on a specific page, use PdfFileAttachmentAnnotation instead. Use one of the static factory methods (FromBytes(Byte, String), FromFile(String), FromExternalPath(String), FromUrl(String)) to create an instance, then pass it to AddFileAttachment on the document, editor, merger or HTML to PDF document options

Definition

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

Properties

Description Optional description displayed next to the file name in the Attachments panel
FileName File name shown in the Attachments panel, including extension (for example, "invoice.xml"). Ignored for URL attachments
MimeType Optional MIME type of the file (for example, "application/xml", "text/csv"). Helps PDF viewers select the correct application when opening the attachment
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

Methods

Equals
(Inherited from Object)
Finalize
(Inherited from Object)
FromBytes Creates an attachment from a byte array. The file content is embedded in the PDF
FromExternalPath Creates an attachment that references an external file by path. The file is not embedded and the reference depends on the PDF reader being able to access the same path. Use FromFile(String) for portable PDFs
FromFile Creates an attachment from a file on disk. The file is read and its content is embedded in the PDF. The file name shown in the Attachments panel is taken from the path
FromUrl Creates an attachment that references a URL. Opens in the default browser when activated
GetHashCode
(Inherited from Object)
GetType
(Inherited from Object)
MemberwiseClone
(Inherited from Object)
ToString
(Inherited from Object)

See Also