22.03.2015 Views

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />

Overview<br />

Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />

The Adobe PDF Library <strong>and</strong> <strong>DLI</strong> will communicate errors back to your application<br />

program by raising an exception. For this reason, it is important that you have<br />

exception h<strong>and</strong>lers placed to catch such errors as close as possible to their source, to<br />

detect the error as soon as possible <strong>and</strong> to limit the damage an error can cause. It is<br />

also important that an outer error catcher be in place, as having no exception h<strong>and</strong>ler<br />

when an exception is raised will cause a fatal error.<br />

NOTE: Follow the development guidelines for error h<strong>and</strong>ling that are included in<br />

the Adobe Acrobat Core API Overview. See chapter 12, “H<strong>and</strong>ling Errors” for more<br />

information.<br />

The Adobe PDF Library provides a mechanism in “C” to define exception h<strong>and</strong>lers.<br />

This mechanism consists of bracketing the code which may cause an exception to be<br />

raised with DURING <strong>and</strong> HANDLER, followed by a block of code to be executed only if<br />

an exception is raised, terminated by END_HANDLER.<br />

CAUTION: Your application must not exit from within the exception h<strong>and</strong>ler.<br />

Doing so will leave the exception h<strong>and</strong>ler frame on the stack, eventually leading to<br />

a stack overflow <strong>and</strong> crash. Your application should exit beyond the<br />

END_HANDLER statement, not within the HANDLER/END_HANDLER block. See<br />

“Risks of Function Returns within Exception H<strong>and</strong>lers” on page 16.3 following<br />

below.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!