| FileAttachmentCreate Method |
Create a file attachment annotation.
The returned file attachment annotation is not yet part of any page.
It can be added to a page's list of annotations.
Namespace: PdfTools.Toolbox.Pdf.AnnotationsAssembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.0.0+fdabb036503e9f99735634a6d4f5be875399e9f5
Syntax public static FileAttachment Create(
Document targetDocument,
Point topLeft,
FileReference attachedFile,
Paint paint
)
Parameters
- targetDocument Document
-
The output document with which the returned object is associated
- topLeft Point
-
The location of the annotation's upper left corner on the page.
- attachedFile FileReference
-
The file to be attached.
- paint Paint
-
This paint for the file attachment icon.
Return Value
FileAttachment
The newly created file attachment annotation.
Exceptions Exception | Condition |
---|
ArgumentException | if the targetDocument has already been closed |
ArgumentException | if the targetDocument is read-only |
ArgumentException | if the color space of the paint argument is not a device color space |
ArgumentException | if the paint has a non-Transparency with BlendMode other than Normal |
ArgumentException | if the paint argument is not associated with the targetDocument |
ArgumentException | if the attachedFile argument is not associated with the targetDocument |
ExistsException | if the attachedFile argument is already used as a plain embedded file, an associated file, or in a file attachment. |
ArgumentNullException | if targetDocument is . |
ArgumentNullException | if attachedFile is . |
ArgumentNullException | if paint is . |
See Also