function SaveAsPdfVTToStream(Stream: TStream; const Options: TPdfVTSaveOptions): Boolean;
SaveAsPdfVTToStream is the streaming counterpart to
SaveAsPdfVT — same output bytes (PDF/X-4 markers
plus PDF/VT identification), written into any seekable TStream the
caller provides. Useful for variable-data print pipelines where
each rendered job is pushed to a digital press or to a billing /
transactional document archive without touching disk.
The post-processing is identical to SaveAsPdfVT: a five-object
injection (XMP stream + ICC stream + OutputIntent dict + rewritten
Info dict + rewritten Catalog dict) plus a trailer with /ID.
Options fields left empty are auto-populated from
FPDF_GetMetaText / FPDF_GetFileIdentifier.
Returns True on success.
var
Stream: TMemoryStream;
Opts: TPdfVTSaveOptions;
begin
Stream := TMemoryStream.Create;
try
Opts := TPdfVTSaveOptions.Default;
Opts.Producer := 'PDFiumVCL VT pipeline';
if Pdf1.SaveAsPdfVTToStream(Stream, Opts) then
begin
Stream.Position := 0;
PushToPress(Stream);
end;
finally
Stream.Free;
end;
end;