THotPDF.ExtractLoadedImageToStream 方法

將一個已載入的 image XObject 直接寫入呼叫端擁有的目的地,而不建立全尺寸位元組陣列

宣告

function ExtractLoadedImageToStream(ImageIndex: Integer;
  Destination: TStream; Mode: THPDFLoadedImageStreamMode= lismEncoded): boolean;

單元

HPDFDoc

參數

名稱用途
ImageIndex來自 GetLoadedImageCount 的從零開始索引
Destination呼叫端擁有的串流,在其目前位置接收位元組
ModelismEncoded 複製原生影像承載,而 lismDecoded 執行通用 PDF 串流篩選器鏈

傳回值

當選取的影像與擷取模式成功完成時傳回 True

使用說明

範例

Output := TFileStream.Create('image.bin', fmCreate);
try
  if not PDF.ExtractLoadedImageToStream(0, Output, lismEncoded) then
    raise Exception.Create('Image extraction failed');
finally
  Output.Free;
end;

相關 API