THotPDF.DecodeLoadedStreamToStream Method

로드된 PDF 스트림을 전체 필터 체인으로 디코딩하고, 최종 단계 출력을 호출자가 소유한 스트림에 바로 기록합니다

선언

function DecodeLoadedStreamToStream(AStream: THPDFStreamObject;
  Output: TStream; out Info: THPDFDecodePipelineInfo): Boolean; overload;
function DecodeLoadedStreamToStream(AStream: THPDFStreamObject;
  Output: TStream; CancellationToken: THPDFCancellationToken;
  out Info: THPDFDecodePipelineInfo): Boolean; overload;

유닛

HPDFDoc

매개변수

이름목적
AStream/Filter 항목을 디코딩할 로드된 THPDFStreamObject
Output현재 위치부터 디코딩된 바이트를 받는 호출자 소유 대상 스트림
CancellationToken사용자 정의 필터 단계와 공유하는 선택적 협조적 취소
Info입출력 바이트 수, 필터 수, 깊이, status, 실패한 필터, 진단 정보를 받습니다

반환 값

요청한 모든 단계가 성공했을 때만 True를 반환합니다

사용 참고 사항

Diagnostics

THPDFDecodePipelineInfo = record
  Status: THPDFDecodePipelineStatus;
  InputBytes: Int64;
  OutputBytes: Int64;
  FilterCount: Integer;
  AppliedFilterCount: Integer;
  CustomFilterCount: Integer;
  CustomFilterFailureCount: Integer;
  PipelineDepth: Integer;
  StopBeforeLast: Boolean;
  FailedFilter: AnsiString;
  Diagnostic: AnsiString;
end;

Status는 잘못된 스트림과 필터, 필터 개수와 깊이 제한, 순환 참조, 재귀 스트림, 지원하지 않는 필터, 예산 초과, 디코더 실패, 사용자 정의 실패, 취소, seek 계약 위반을 구분합니다

Example

Output := TFileStream.Create('payload.bin', fmCreate);
try
  if not PDF.DecodeLoadedStreamToStream(StreamObject, Output, Info) then
    raise Exception.Create(String(Info.Diagnostic));
finally
  Output.Free;
end;

관련 API