AddAssociatedFile(CosDictionary, PdfFileSpecification) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Associates file with owner by adding it to the owner's AF array.

public void AddAssociatedFile(CosDictionary owner, PdfFileSpecification file)

Parameters

owner
CosDictionary

The dictionary the file is associated with: the Catalog, a page's Dictionary, an annotation, a structure element, an XObject's stream dictionary, a document part or a marked-content property list.

file
PdfFileSpecification

A file specification dictionary of this document; its AFRelationship says how the file relates to the owner.

Remarks

ISO 32000-2 §14.13.1 to §14.13.9 (PDF 2.0): AF is an array of file specification dictionaries; the specification is added by its indirect reference when it has one. A file already in the array is not added twice. An AF that is a single dictionary (read leniently as an array of one) becomes an array holding it and the new file; an AF that is neither is replaced. An embedded associated file should have a Subtype and Params with ModDate (§14.13.2), which CreateEmbeddedFile(String, ReadOnlySpan<Byte>, PdfEmbeddedFileOptions?) writes when ModificationDate is set. Minimum version PDF 2.0, which a later save raises the document to (or refuses in strict mode). A mutation: no read may run concurrently with it.