PDFium Delphi Component Docs

SaveAsWithAssociateFilesToStream 메서드

컴포넌트: TPdf  ·  유닛: PDFium
SaveAsWithAssociateFiles의 인메모리 변형으로, 디스크에 임시 저장하지 않고 삽입된 연관 파일이 포함된 PDF 출력을 임의의 탐색 가능한 TStream에 씁니다

Syntax

function SaveAsWithAssociateFilesToStream(Stream: TStream; const Options: TAssocFilesOptions): Boolean;

StreamTStream. The target stream that receives the PDF data
OptionsTAssocFilesOptions. Injection options detailing files, metadata, and the target catalog or page attachment point

Return Value

연관 파일이 삽입된 PDF가 스트림에 성공적으로 기록되면 True를 반환하고, 실패하면 False를 반환합니다

Description

SaveAsWithAssociateFilesToStream은 SaveAsWithAssociateFiles의 스트리밍 상응 기능입니다. 파일 경로 대신 ISO 32000-2 §7.11.4를 준수하는 연관 파일을 출력 스트림에 직접 포함시킵니다

Remarks

Example

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;

See Also

SaveAsWithAssociateFiles, SaveAs