THotPDF.SetLoadedXMPMetadata Method
Writes the complete XMP metadata XML string to the loaded PDF document's metadata stream, replacing the existing XMP packet
Declaration
procedure SetLoadedXMPMetadata(const AXML: AnsiString);
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
AXML | 符合 XMP 规范的完整 XML 字符串,通常以 <?xpacket begin=...> 开头并包含 RDF 元素 |
Usage notes
- 传入的 XML 字符串须为合法的 XMP 数据包格式,否则部分 PDF 阅读器在验证元数据时可能报错
- This method replaces the entire XMP stream; if only partial fields need modifying, the existing XMP content should first be read, edited in memory, and then passed back
- XMP metadata and the information dictionary complement each other and may be inconsistent; it is recommended to use methods such as SetLoadedAuthor simultaneously to keep them synchronised