Error Messages

Exception codes and error messages for the Adobe PDF Library are listed in the AcroErr.h header file. You will find this in the product installation package, in the directory called /CPlusPlus/Include/Headers.

We describe how error messages are formatted in the Library below.

Adobe PDF Library provides each error code as a series of bit field values concatenated together. It is easier to read if you use a decimal to hexadecimal code converter utility to convert the error code to hex notation, and then parse the hex version of the error code.

For example, 1073938471 can be converted to hex code 40030027. You can then parse that hex code into four fields:

40030027 4 Severity Level. None, Warning, or Severe. The width of the field is 4 bits, and the format is designed to allow for up to 16 possible Severity Levels (2 to the 4th power).  The Library provides three levels, but you can your own custom Severity levels if you like.
40030027 0 Unused
40030027 03 System Number. This refers to internal systems within the Adobe PDF Library, or categories of the type of errors displayed. Adobe PDF Library provides 19 default System types, but provides room for up to 256, so you can add many more System types to your APDFL application. The default error messages provided by the Library are listed below.
ErrSysNone General errors
ErrSysCos General Cos errors
ErrSysCosSyntax Cos syntax errors
ErrSysPDDoc PDDoc and family, Page tree, outlines errors
ErrSysPDPage PDPage and family, thumbs, annotations errors
ErrSysPDModel Global PD errors
ErrSysAcroView AcroView errors
ErrSysPage Page parsing and RIPping errors
ErrSysFontSvr Font Server errors
ErrSysRaster Rasterizer errors
ErrSysASFile ASFile I/O errors
ErrSysXtnMgr Extension Manager errors
ErrSysXtn New error codes added by extensions
ErrSysMDSystem Platform-specific system errors
ErrSysMDApp Platform-specific application errors
ErrSysPDFX PDFX-specific errors
ErrSysPDFEdit PDFEdit errors
ErrSysPDSEdit PDSEdit (structure) errors
ErrSysPDMetadata XAP Metadata errors
40030027 0027 Error Number. This code maps to the individual error message, such as "pdErrNeedPassword," which means that a required password is missing. The error number refers to the position of the error message in the list of error messages for the System. In this example, error number 0027 would be the 27th message found under system number 3, Cos Syntax Errors. So each error number is unique.
Note:If you have a question about an error message, please contact your Datalogics Support Representative.

When using the core C interface, you can get the error message associated with an error code using ASGetErrorString:

  char buf[256];
  ASGetErrorString(ERRORCODE, buf, sizeof(buf));
  fprintf(stderr, "Error code: %ld, Error Message: %sn", ERRORCODE, buf);

When using the Java and .NET interfaces, errors are represented with the LibraryException class. A user should see the message portion when the system catches an exception:

  catch (Exception e)
  Console.Writeline("Library error: "+ e);