DAOpenMappedFile

Document management, Direct access functionality, Performance

Description

Opens a local PDF for Direct Access through a bounded read-only mapped view without retaining the complete file in memory

Syntax

Delphi

Function TPDFlib.DAOpenMappedFile(Const InputFileName, Password: WideString;
  WindowSize: Int64= 0; Options: Integer= 0): Integer;

Parameters

InputFileNameThe path of the local PDF
PasswordThe document password, or an empty string when the PDF is not encrypted
WindowSizeThe requested mapped-view size in bytes; zero selects 64 MiB and the effective value is aligned and capped at 1 GiB
OptionsZero permits a read-only file-stream fallback, while PDF_MAPPED_FILE_REQUIRE_MAPPING requires an active mapped view

Return values

>0A Direct Access document handle
0The arguments, file, password, mapping requirement or PDF structure were invalid; inspect LastErrorCode

Remarks

The returned handle owns the mapped source and releases its view and file handles when passed to DACloseFile

The retained window is remapped on demand for page, object and stream reads; all reads remain bounded by the physical file size

DAGetMappedFileInfo to inspect source and remapping statistics for the handle