THPDFJSONValue.SerializeBounded
Checks a conservative escaped JSON size before allocating the serialised UTF-8 result
function SerializeBounded(MaxBytes: Int64): AnsiString;
The unit is HPDFDocJobs; MaxBytes must be positive and at most MaxInt, and nested containers may go no deeper than 64
String estimates allow six output bytes per UTF-16 code unit and account for object keys and delimiters; the estimate may overshoot the final UTF-8 size
An estimate or actual result beyond MaxBytes raises EHPDFJobBudgetExceeded with metric resultBytes; the existing Serialize method keeps its behaviour