SaveImageListItemNativeDataToFile

影像

描述

將單一影像清單項目的原始編碼 PDF 串流位元組寫入檔案,不進行解碼或重新編碼

語法

Delphi

Function SaveImageListItemNativeDataToFile(ImageListID, ImageIndex: Integer; Const ImageFileName: WideString): Integer;

參數

ImageListID由 GetPageImageList 或其他影像列舉傳回的影像清單控制代碼
ImageIndex清單中的項目索引(1 起算)
ImageFileName目的檔案路徑;既有檔案會被取代,原生酬載為空時不寫入任何內容

傳回值

0沒有成功寫入任何檔案
1原生串流位元組已寫入

失敗行為

當影像清單控制代碼或以 1 為起始的項目索引無效、原生串流為空,或無法建立或寫入輸出檔案時,會傳回 0;檔案系統例外狀況會被捕捉並回報為 0

備註

現有的輸出檔案會被取代。請使用 GetImageListItemNativeFormat 選擇適當的副檔名;儲存的位元組保持與影像 XObject 中儲存時完全相同的編碼,因此 flate 資料不是可直接顯示的點陣圖,而 unknown 鏈可能需要額外的 PDF 篩選器

範例

if PDF.GetImageListItemNativeFormat(ListID, 1)= 'jpeg' then
  Saved:= PDF.SaveImageListItemNativeDataToFile(ListID, 1, 'image1.jpg');

另請參閱

GetImageListItemNativeDataToString, GetImageListItemNativeFormat, SaveImageListItemDataToFile