API referencePDF/A & Conformance

pdfAnsiStringResultLength

pdfAnalyseFile reads and inspects an arbitrary,

C
int32_t __stdcall pdfAnalyseFileA(PPDF IPDF, const char* InputFileName, const char* Password);
int32_t __stdcall pdfAnsiStringResultLength(PPDF IPDF);
Delphi
function pdfAnalyseFileA(const IPDF: PPDF; InputFileName, Password: PAnsiChar): Integer; stdcall;
function pdfAnsiStringResultLength(const IPDF: PPDF): Integer; stdcall;

Purpose. pdfAnalyseFile reads and inspects an arbitrary, independent PDF file (not the currently-open document or its import source) for basic structural statistics; pdfAnsiStringResultLength reports the exact byte length of the last ANSI (A-suffixed) string result this SDK's shared transient buffer holds — useful because a PAnsiChar result alone can't represent an embedded null byte.

Description. pdfAnalyseFile is genuinely real: opens InputFileName as a completely separate, independent TPdfSourceDoc (decrypted with Password if needed), and records file size, page count, object count (XRef.Count), max object number, PDF header version, whether it's encrypted, and whether it has an AcroForm — into an internal, growable FAnalyses list keyed by an auto-incrementing analysis ID (returned here, consumed later by the separate pdfGetAnalysisInfo getter, not part of this volume's list). Multiple analyses can be retained simultaneously (each gets its own ID), independent of the currently open document. pdfAnsiStringResultLength is a pure accessor — Length(D.GapRetA), the same shared transient ANSI buffer many other A-suffixed the engine functions write their results into.

Parameters.

ParameterDescription
IPDFDocument handle (used only for context; the analyzed file is entirely independent of any currently-open document).
InputFileNamePath to the PDF file to analyze.
PasswordPassword to decrypt it, if needed.

Return value. pdfAnalyseFile: a new analysis ID on success; 0 on failure (file missing/empty/invalid, or bad password). pdfAnsiStringResultLength: the exact byte length of the shared ANSI result buffer's current contents.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfAnsiStringResultLength(IntPtr IPDF);
Area
PDF/A & Conformance
Category

Core

Exported names

pdfAnsiStringResultLength

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.