API referenceImport & Output APIs

pdfRetrieveCustomDataToFile

Write the blob stored under (Location, Key) to FileName (created or overwritten).

Write the blob stored under (Location, Key) to FileName (created or overwritten). Companion pdfRetrieveCustomDataToString returns the bytes as a pointer valid until the next string-returning gap call on the instance.

C
int32_t __stdcall pdfRetrieveCustomDataToFileA(PPDF IPDF, const char*    Key, const char*    FileName, int32_t Location);
int32_t __stdcall pdfRetrieveCustomDataToFileW(PPDF IPDF, const wchar_t* Key, const wchar_t* FileName, int32_t Location);

Return value1 on success; 0 if the key is unknown at that location or the file cannot be written.

Open-action & action read-back

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfRetrieveCustomDataToFileW(IntPtr IPDF, IntPtr Key, IntPtr FileName, int Location);
public static extern int pdfRetrieveCustomDataToFile(IntPtr IPDF, IntPtr Key, IntPtr FileName, int Location);
public static extern int pdfRetrieveCustomDataToFileA(IntPtr IPDF, IntPtr Key, IntPtr FileName, int Location);
Area
Import & Output APIs
Category

Core

Exported names

pdfRetrieveCustomDataToFileW pdfRetrieveCustomDataToFile pdfRetrieveCustomDataToFileA

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.