HPDFSerializeHeadlessObject
function HPDFSerializeHeadlessObject(Obj: THPDFObject;
MaxBytes: Integer; MaxDepth: Integer = 64): AnsiString;
Serialize 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 serialization
Budget violations raise EHPDFHeadlessDocumentError with hdLimitExceeded before publication; the caller retains ownership of Obj