API referenceImages

pdfCloseImage

Close/clear the staged image slot left by pdfCreateImage

C
BOOL32 __stdcall pdfCloseImage(PPDF IPDF);
Delphi
function pdfCloseImage(const IPDF: PPDF): LongBool; stdcall;

Purpose. Close/clear the staged image slot left by pdfCreateImage (Image Insertion and Replacement) — the handle of the most recently created-but-not-yet-placed image.

Description. CloseStagedImage reports success (True) only if a staged image handle was actually pending (FStagedImage > 0), then resets FStagedImage to 0 regardless. This does not delete the image entry itself from FImages — same "no delete API exists" caveat as pdfFreeImageObj above — it only clears the bookkeeping slot that tracks "the most recently staged-but-unplaced" image; the image remains fully usable via its handle (e.g. through pdfPlaceImage) after this call.

Parameters.

ParameterDescription
IPDFDocument handle.

Return value. True if a staged image was pending and its slot was cleared; False if nothing was staged (e.g. pdfCloseImage called twice in a row, or no pdfCreateImage call preceded it).

See also. pdfCreateImage.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Images
Category

Core

Exported names

pdfCloseImage

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.