Click or drag to resize

PdfAssociatedFileCollectionAdd(PdfAssociatedFileRelationshipType, String, String, PdfEmbeddedFileSpecificationTree) Method

Adds a new PdfFileSpecification with the specified relationship and the EmbeddedFile copied from the resource specified by the filePath.

Namespace: SautinSoft.Pdf
Assembly: SautinSoft.Pdf (in SautinSoft.Pdf.dll) Version: 2024.8.8
Syntax
public PdfFileSpecification Add(
	PdfAssociatedFileRelationshipType associatedRelationshipType,
	string filePath,
	string mediaType = null,
	PdfEmbeddedFileSpecificationTree embeddedFiles = null
)

Parameters

associatedRelationshipType  PdfAssociatedFileRelationshipType
The relationship between the component of a PDF document that refers to this PdfAssociatedFileCollection and the newly added PdfFileSpecification.
filePath  String
The location of the resource copied to the EmbeddedFile of a newly added PdfFileSpecification. This value is also used to resolve the Name and a key in the PdfEmbeddedFileSpecificationTree (if embeddedFiles is not ) of a newly added PdfFileSpecification.
mediaType  String  (Optional)
The media type of the embedded file.
embeddedFiles  PdfEmbeddedFileSpecificationTree  (Optional)
The EmbeddedFiles to which the newly created PdfFileSpecification should be added or .

Return Value

PdfFileSpecification
A newly created PdfFileSpecification with the specified relationship and the EmbeddedFile copied from the resource specified by the filePath added to the PdfAssociatedFileCollection.
Exceptions
ExceptionCondition
ArgumentNullExceptionfilePath is or Empty.
Remarks
The EmbeddedFile's Size, CreationDate, ModificationDate, and MediaType properties are automatically set, if they can be resolved from the resource specified by the filePath.
See Also