HPDFRenderHeadlessPagePNGFile

function HPDFRenderHeadlessPagePNGFile(const Access: THPDFHeadlessRenderAccess;
  const FileName: string; const Options: THPDFHeadlessRenderOptions):
  THPDFHeadlessRenderResult;

Declared in HPDFHeadlessCairoDevice; renders one borrowed page and atomically publishes its PNG to FileName

The parent directory must already exist; a successful call replaces an existing destination and returns its render counters

Access.RequireOutputPath is required and checks the source path and physical file identity before staging and before publication; the document's GetRenderAccess supplies this callback

Source-path and source-hardlink aliases are rejected; the borrowed document remains loaded and unchanged throughout the call

The helper exclusively creates an owned staging file beside the destination, writes the completed PNG, flushes the file, checks cancellation again, and performs an atomic rename or replacement

Budget, rendering, cancellation and staging failures preserve an existing destination and delete the owned unpublished staging file

Windows uses at most eight atomic replacements, retrying only errors 5, 32 and 33 with waits of 1, 2, 4, 8, 16, 16 and 16 milliseconds; all other errors fail immediately

Cancellation is checked before every replacement attempt and before and after each wait; no destination deletion or non-atomic copy is used as a fallback

A failed Windows replacement raises EHPDFHeadlessRenderError carrying the captured final Windows error code; cancellation preserves the renderer's cancellation diagnostic

For streams use HPDFRenderHeadlessPagePNG; see the renderer guide for format and resource boundaries