StoreCustomDataFromFile
文件屬性
描述
把來自檔案的自訂資料以鍵名存進 PDF,之後可用 RetrieveCustomDataToString 或 RetrieveCustomDataToFile 取出。可設定儲存類型(字串、串流或壓縮串流)與位置(Document Information Dictionary 或 Document Catalog)。位置為 Document Catalog 時任何儲存類型都可以,但鍵必須加上 Adobe 核配給你的特殊字首;位置為 Document Information Dictionary 時,除標準鍵以外的任何鍵都能用,但只能存字串
語法
Delphi
Function TPDFlib.StoreCustomDataFromFile(Const Key, FileName: WideString; Location, Options: Integer): Integer;
ActiveX
Function PDFlib::StoreCustomDataFromFile(Key As String, FileName As String, Location As Long, Options As Long) As Long
DLL
int DLStoreCustomDataFromFile(int InstanceID, const wchar_t * Key, const wchar_t * FileName, int Location, int Options);
參數
| Key | 儲存資料所用的鍵。位置為 Document Information Dictionary 時,鍵不能是 "Author"、"Title"、"Subject"、"Keywords"、"Creator" 或 "Producer";其他任何鍵都可以,但應審慎挑選,讓使用者看得懂。位置為 Document Catalog 時,鍵必須加上 Adobe 核配給你的特殊字首,避免與其他軟體衝突 |
|---|---|
| FileName | 含要存入 PDF 指定鍵之下資料的檔案路徑與名稱。 |
| Location | 1 = 將資料儲存在 Document Information Dictionary 中 2 = 將資料儲存在 Document Catalog 中 |
| Options | 0 = 將資料儲存為字串(位置為 Document Information Dictionary 時唯一可用的選項) 1 = 將資料儲存在串流中 2 = 將資料儲存在壓縮串流中 |
傳回值
| 0 | 無法開啟含資料的檔案,或 Key 參數無效 |
|---|---|
| 1 | 資料儲存成功 |