BOOL32 __stdcall pdfFreeImageObj(PPDF IPDF, uint32_t Handle);
function pdfFreeImageObj(const IPDF: PPDF; Handle: Cardinal): LongBool; stdcall;
Purpose. Release the transient, shared read-back buffer populated by a prior pdfGetImageObj call — despite the "Free…Obj" name matching pdfFreeImageObjEx, this operates on a completely different kind of object.
Description. Does not remove, delete, or otherwise mutate the document's image list — Handle = 0 clears the shared transient buffer (FImgObjBuf) that pdfGetImageObj (not Ex) points its returned Image.Buffer into, returning success as long as at least one image exists in the document; a specific non-zero Handle simply verifies that handle still exists in FImages (also clearing the same shared buffer as a side effect) without deleting that image entry either. The underlying FImages entry and every page reference to it survive this call unconditionally — there is no image-deletion API exposed in this ABI at all; images, once inserted, persist for the life of the document.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Handle | 0 = release the shared read-back buffer unconditionally (if any image exists); non-zero = verify that handle exists (as a side effect, also releases the shared buffer). |
Return value. True if the buffer was released / the handle exists; False if no images exist in the document (Handle=0 case) or the specific handle is unknown.
See also. pdfFreeImageObjEx (the real, independent-object counterpart — not the same mechanism).
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfFreeImageObj
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.