AddPageAssociatedFileFromFile

Embedded files

Description

Binds an embedded file read from disk to one page's /AF array

Syntax

Delphi

Function AddPageAssociatedFileFromFile(PageNumber: Integer; Const FileName, DisplayName, MIMEType, Description, Relationship: WideString): Integer;

Parameters

PageNumberOne-based page number whose /AF array receives the file specification
FileNamePath of an existing file to embed
DisplayNameName shown for the embedded file; an empty value uses the source file name without its directory path, and the resulting title must not duplicate an existing embedded-file title
MIMETypeMIME type stored in the file specification; must not be empty
DescriptionOptional description stored in the associated-file entry; may be empty
RelationshipRelationship role, one of Source, Data, Alternative, Supplement or Unspecified

Return values

0The file does not exist or validation failed
RefHandle of the new file specification object

Remarks

DisplayName defaults to the file name extracted from FileName when left empty. The remaining parameters and the page-level /AF semantics follow AddPageAssociatedFileFromString

Example

PDF.AddPageAssociatedFileFromFile(2, "schema.xsd", "", "application/xml", "", "Supplement");

See also

AddAssociatedFileFromString, GetAssociatedFileCount