function SaveAsWithXmpPacket(Stream: TStream; Packet: TPdfXmpPacket; AllowSignedDocument: Boolean = False): Boolean;
| Stream | TStream. Destination stream |
| Packet | TPdfXmpPacket. Packet to write, normally obtained from ReadXmpPacket and edited. The caller keeps ownership |
| AllowSignedDocument | Boolean. Pass True to permit rewriting a signed document. Defaults to False |
| Result | Boolean. True when the document was written |
function SaveAsWithXmpPacket(const FileName: string; Packet: TPdfXmpPacket; AllowSignedDocument: Boolean = False): Boolean;
| FileName | string. Destination file, written atomically through a temporary file in the same directory |
| Packet | TPdfXmpPacket. Packet to write |
| AllowSignedDocument | Boolean. Permit rewriting a signed document |
| Result | Boolean. True when the file was written |
Replaces the document metadata stream with the serialised packet as the file is written, which keeps metadata edits and document edits in one save rather than a second rewriting pass
Rewriting a signed document invalidates its signatures, so that case is refused unless the caller opts in explicitly
Conformance profiles read their claims from XMP, so a packet edited here is what tools such as ValidatePdfA will see afterwards