THPDFJSONValue.SerializeBounded
Checks a conservative escaped JSON size before allocating the serialized UTF-8 result
function SerializeBounded(MaxBytes: Int64): AnsiString;
The unit is HPDFDocJobs; MaxBytes must be positive and at most MaxInt, and nested containers are limited to depth 64
String estimates allow six output bytes for each UTF-16 code unit and account for object keys and delimiters; the estimate can exceed the final UTF-8 size
An estimate or actual result exceeding MaxBytes raises EHPDFJobBudgetExceeded with metric resultBytes; the existing Serialize method retains its behavior