pdfRetrieveCustomDataToString
A generic, key-value custom-data blob store/retrieve
int32_t __stdcall pdfStoreCustomDataFromString(PPDF IPDF, const char* Key, const char* NewValue, int32_t Location, int32_t Options);
const char* __stdcall pdfRetrieveCustomDataToString(PPDF IPDF, const char* Key, int32_t Location);
function pdfStoreCustomDataFromString(const IPDF: PPDF; Key, NewValue: PAnsiChar; Location, Options: Integer): Integer; stdcall;
function pdfRetrieveCustomDataToString(const IPDF: PPDF; Key: PAnsiChar; Location: Integer): PAnsiChar; stdcall;
Purpose. A generic, key-value custom-data blob store/retrieve mechanism, scoped by Location (a storage-target selector — e.g. document-level vs. some other object-level scope; this chapter did not independently re-verify the full enumeration of valid Location values).
Description. Options is accepted by pdfStoreCustomDataFromString but never passed through to StoreCustomDataBlob — no options-driven behavior (e.g. encoding, overwrite policy) is reachable regardless of value. Both require a non-empty Key.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Key | Non-empty lookup key; empty/nil fails both. |
NewValue | *(Store only)* The value to store. |
Location | Storage scope selector. |
Options | *(Store only)* Accepted but silently dropped. |
Return value. pdfStoreCustomDataFromString: 1 on success, 0 if Key is empty/nil or IPDF invalid. pdfRetrieveCustomDataToString: pointer to the stored value (transient buffer), or nil if Key doesn't resolve.
See also. pdfStoreCustomDataFromFile/pdfRetrieveCustomDataFromFile (file-based siblings, not covered in this volume).
C# (P/Invoke)
public static extern IntPtr pdfRetrieveCustomDataToString(IntPtr IPDF, IntPtr Key, int Location);
Core
pdfRetrieveCustomDataToString
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.