HPDFSerializeHeadlessObject
function HPDFSerializeHeadlessObject(Obj: THPDFObject;
MaxBytes: Integer; MaxDepth: Integer = 64): AnsiString;
Serialise a headless PDF object with explicit output-byte and nesting-depth limits for bounded content preparation
The result preserves PDF name and string encoding and indirect references; stream objects include their bounded byte payload rather than allocating an unbounded temporary serialisation
Budget violations raise EHPDFHeadlessDocumentError with hdLimitExceeded before publication; ownership of Obj stays with the caller