TPDFlibValidationOpen

Data types, compliance

Description

Opens and parses a PDF once and retains its reader, security information, document object graph and lazy object cache for several validation tasks. The member that belongs to Input carries the source; the other source arguments stay empty.

TPDFlib declares the public methods and a protected dispatch method for opening a reusable validation pipeline. The edition class supplies the implementation as a callback of this type. A plain TPDFlib instance supplies none, so the call returns the documented empty result and sets LastErrorCode to PDFLIB_ERROR_ENTERPRISE_REQUIRED. Application code never declares, assigns or calls a value of this type.

Syntax

Delphi

TPDFlibValidationOpen = Function(Input: TPDFlibValidationInput;
  Const SourceName, Password: WideString; Source: TStream;
  Buffer: Pointer; ByteCount: NativeInt; CopyBuffer: Boolean): Integer Of Object;

Parameters

InputKind of source: vpiFile, vpiStream or vpiBuffer
SourceNamePath of the PDF file for vpiFile; a label used in validation reports otherwise
PasswordOpen password, or an empty string for an unencrypted file
SourceReadable, seekable stream holding the PDF for vpiStream; Nil otherwise
BufferPointer to readable memory holding the complete PDF for vpiBuffer; Nil otherwise
ByteCountNumber of bytes in Buffer; 0 otherwise
CopyBufferFor vpiBuffer: True retains a private copy of the bytes, False borrows the memory of the caller

Return values

Positive valuePipeline identifier accepted by the validation pipeline methods
0The PDF could not be opened, parsed or decrypted

See also

TPDFlibValidationInput, TPDFlibValidationAction, TPDFlibValidationRun, BeginValidationPipelineFromBuffer