AddPageAssociatedFileFromFile
嵌入文件
描述
将从磁盘读取的嵌入文件绑定到一个页面的 /AF 数组
语法
Delphi
Function AddPageAssociatedFileFromFile(PageNumber: Integer; Const FileName, DisplayName, MIMEType, Description, Relationship: WideString): Integer;参数
| PageNumber | 其 /AF 数组接收该文件规范的页的从 1 开始编号 |
|---|---|
| FileName | 要嵌入的现有文件路径 |
| DisplayName | 嵌入文件显示的名称;空值使用源文件名(不含目录路径),生成的标题不得与现有嵌入文件标题重复 |
| MIMEType | 存储在文件规范中的 MIME 类型;不得为空 |
| Description | 存储在关联文件条目中的可选描述;可为空 |
| Relationship | 关系角色,取 Source、Data、Alternative、Supplement 或 Unspecified 之一 |
返回值
| 0 | 文件不存在或验证失败 |
|---|---|
| Ref | 新文件规范对象的句柄 |
备注
DisplayName 留空时默认为从 FileName 中提取的文件名。其余参数和页面级 /AF 语义遵循 AddPageAssociatedFileFromString
示例
PDF.AddPageAssociatedFileFromFile(2, "schema.xsd", "", "application/xml", "", "Supplement");