API Reference
Class
PdfDocumentAttachments
Existing-document embedded and associated file editing operations.
Inheritance
- Object
- PdfDocumentAttachments
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Property PdfDocument.Attachments
Methods
public PdfAttachmentEditResult Add(PdfEmbeddedFile attachment) #Returns:
PdfAttachmentEditResultAdds one attachment.
Parameters
- attachment OfficeIMO.Pdf.PdfEmbeddedFile
public PdfAttachmentEditResult Edit(Action<PdfAttachmentEditSession> edit) #Returns:
PdfAttachmentEditResultApplies a transactional attachment collection edit.
Parameters
- edit System.Action{OfficeIMO.Pdf.PdfAttachmentEditSession}
Extract 2 overloads
public IReadOnlyList<PdfExtractedAttachment> Extract(PdfLoadOptions readOptions = null) #Returns:
IReadOnlyList<PdfExtractedAttachment>Extracts every embedded or associated file payload.
Parameters
- readOptions OfficeIMO.Pdf.PdfLoadOptions = null
public PdfExtractedAttachment Extract(PdfAttachmentInfo attachment, Int64 maximumDecodedBytes, CancellationToken cancellationToken = default) #Returns:
PdfExtractedAttachmentExtracts one selected attachment without decoding unrelated payloads.
Parameters
- attachment OfficeIMO.Pdf.PdfAttachmentInfo
- maximumDecodedBytes System.Int64
- cancellationToken System.Threading.CancellationToken = default
public PdfOperationResult<IReadOnlyList<PdfExtractedAttachment>> ExtractResult(PdfLoadOptions readOptions = null) #Returns:
PdfOperationResult<IReadOnlyList<PdfExtractedAttachment>>Attempts to extract attachment payloads, returning preflight diagnostics when blocked or failed.
Parameters
- readOptions OfficeIMO.Pdf.PdfLoadOptions = null
Remove 2 overloads
public PdfAttachmentEditResult Remove(String fileName) #Returns:
PdfAttachmentEditResultRemoves one attachment.
Parameters
- fileName System.String
public PdfAttachmentEditResult Remove(PdfAttachmentInfo attachment) #Returns:
PdfAttachmentEditResultRemoves one selected attachment by its source object identity.
Parameters
- attachment OfficeIMO.Pdf.PdfAttachmentInfo
public PdfAttachmentEditResult Rename(String fileName, String newFileName) #Returns:
PdfAttachmentEditResultRenames one attachment.
Parameters
- fileName System.String
- newFileName System.String
public PdfAttachmentEditResult Replace(String fileName, PdfEmbeddedFile replacement) #Returns:
PdfAttachmentEditResultReplaces one attachment by file name.
Parameters
- fileName System.String
- replacement OfficeIMO.Pdf.PdfEmbeddedFile