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
| Input | Kind of source: vpiFile, vpiStream or vpiBuffer |
|---|---|
| SourceName | Path of the PDF file for vpiFile; a label used in validation reports otherwise |
| Password | Open password, or an empty string for an unencrypted file |
| Source | Readable, seekable stream holding the PDF for vpiStream; Nil otherwise |
| Buffer | Pointer to readable memory holding the complete PDF for vpiBuffer; Nil otherwise |
| ByteCount | Number of bytes in Buffer; 0 otherwise |
| CopyBuffer | For vpiBuffer: True retains a private copy of the bytes, False borrows the memory of the caller |
Return values
| Positive value | Pipeline identifier accepted by the validation pipeline methods |
|---|---|
| 0 | The PDF could not be opened, parsed or decrypted |
See also
TPDFlibValidationInput, TPDFlibValidationAction, TPDFlibValidationRun, BeginValidationPipelineFromBuffer