Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 348

Previous Page 347   Index   Next Page 349

Function Reference
Page 348 of 750
GetErrLogMessage
Syntax:
LBOOL pdfGetErrLogMessage(
const PPDF* IPDF,
// Instance pointer
UI32 Index,
// Array index
struct TPDFError* Err) // see below
struct TPDFError
{
UI32
StructSize; // Must be initialized to sizeof(TPDFError)
const char* Message;
// The error message
SI32
ObjNum;
// PDF object number or -1 if not available
SI32
Offset;
// File offset or -1 if not available
const char* SrcFile;
// Source file
UI32
SrcLine;
// Source line
};
The function returns an error object of the internal error log. The function GetErrLogMessageCount()
returns the number of available error messages.
DynaPDF uses the error log to store non-fatal errors or warnings when it is not required to break
processing or if more detailed error information should be provided than is possible with the normal
exception handling.
For example, when opening a damaged PDF file with OpenImportFile() the function tries first to
open the file in normal mode. All errors which occur in this step are written to the error log.
Depending on the kind of found errors, the function maybe falls back into repair mode and reads the
file again. If this action is successful then the function returns with success and no error message is
provided over the normal exception handling. So, you'll not notice that the file contained damages
unless you take a look into the error log.
The error log was introduced with DynaPDF 3.0. It is currently used when reading a PDF file, e.g.
OpenImportFile(), ImportPage(), ImportPDFFile(), and when parsing or rendering PDF pages, e.g.
ParseContent(), IsEmptyPage(), IsColorPage(), GetPageText(), RasterPage(), RasterPDFFile(), and so
on. However, the error log will be integrated in all functions which can produce multiple warnings
like InsertImage(), InsertMetafile(), AddRenderingIntent() and so on.
The number of possible error messages is restricted by default to 100 messages per PDF instance.
However, it is possible to adjust the maximum number of messages with SetMaxErrLogMsgCount().
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0. Check whether
the member StructSize of the structure TPDFError was properly initialized in the latter case.
 

Previous topic: GetEMFPatternDistance

Next topic: GetErrorMode