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
| PageNumber | One-based page number whose /AF array receives the file specification |
|---|---|
| FileName | Path of an existing file to embed |
| DisplayName | Name 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 |
| MIMEType | MIME type stored in the file specification; must not be empty |
| Description | Optional description stored in the associated-file entry; may be empty |
| Relationship | Relationship role, one of Source, Data, Alternative, Supplement or Unspecified |
Return values
| 0 | The file does not exist or validation failed |
|---|---|
| Ref | Handle 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");