Table of Contents

Method Add

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

Add(string, PdfFileSpecification)

Adds the given file specification to the PdfFileSpecificationMap.

public void Add(string key, PdfFileSpecification fileSpec)

Parameters

key string

The key to associate with the file specification.

fileSpec PdfFileSpecification

The file specification to add to the PdfFileSpecificationMap.

Remarks

If an entry with the same key string already exists, it is overwritten. Use Contains(string) to check whether a key is already present.

The key is an arbitrary string used to organize file specifications in the underlying PDF structure. A common choice is the value of Specification from fileSpec. To avoid unintended overwrites, you may append a suffix (for example, (2) or -1).

The key may influence the order in which file attachments appear in PDF viewers. Adobe Reader sorts attachments by Specification, while some viewers such as Foxit PDF Reader and PDF-XChange Editor use the value of key instead.

Exceptions

ArgumentNullException

Thrown when key or fileSpec is null.

ArgumentException

Thrown when fileSpec belongs to another document and cannot be added.