function SaveAsWithAssociateFilesToStream(Stream: TStream; const Options: TAssocFilesOptions): Boolean;
| Stream | TStream. The target stream that receives the PDF data |
| Options | TAssocFilesOptions. Injection options detailing files, metadata, and the target catalog or page attachment point |
True dacă PDF-ul cu fișierele asociate injectate a fost scris cu succes în flux, sau False în caz de eșecSaveAsWithAssociateFilesToStream este omologul pentru fluxuri al SaveAsWithAssociateFiles — încorporează fișierele asociate în conformitate cu ISO 32000-2 §7.11.4 direct în fluxul de ieșire în loc de o cale de fișier
Write, cât și Seek
var
Stream: TMemoryStream;
Opts: TAssocFilesOptions;
F: TAssociateFile;
begin
Stream := TMemoryStream.Create;
try
Opts := TAssocFilesOptions.Default;
Opts.TargetPage := 0;
F.FileName := 'data.xml';
F.Content := GetXmlBytes;
F.Relationship := afData;
F.MIMEType := 'text/xml';
SetLength(Opts.Files, 1);
Opts.Files[0] := F;
if Pdf1.SaveAsWithAssociateFilesToStream(Stream, Opts) then
begin
Stream.Position := 0;
SendToNetwork(Stream);
end;
finally
Stream.Free;
end;
end;