17.05.2014 Views

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Supply your license key at runtime using <strong>PDFlib</strong>’s set_parameter( ) function, supplying<br />

license as first parameter, and the actual license key as second parameter (see also<br />

Section 0, »Applying the <strong>PDFlib</strong> License Key«, page 9):<br />

oPDF.set_parameter("license", "...your license key ...")<br />

Error handling in <strong>COM</strong>. Error handling for the <strong>PDFlib</strong> <strong>COM</strong> component is done according<br />

to <strong>COM</strong> conventions: when a <strong>PDFlib</strong> exception occurs, a <strong>COM</strong> exception is raised and<br />

furnished with a clear-text description of the error. In addition the memory allocated by<br />

the <strong>PDFlib</strong> object is released.<br />

The <strong>COM</strong> exception can be caught and handled in the <strong>PDFlib</strong> client in whichever way<br />

the client environment supports for handling <strong>COM</strong> errors. A more detailed discussion<br />

of <strong>PDFlib</strong>’s exception mechanism can be found in Section 3.1.1, »Exception Handling«,<br />

page 59.<br />

Using <strong>PDFlib</strong> with Active Server Pages. When using external files (such as image files)<br />

ASP’s MapPath facility must be used in order to map path names on the local disk to<br />

paths which can be used within ASP scripts. Take a look at the ASP samples supplied<br />

with <strong>PDFlib</strong>, and the ASP documentation if you are not familiar with MapPath. Don’t<br />

use absolute path names in ASP scripts since these may not work without MapPath.<br />

Note UNC path names don’t work in IIS.<br />

The directory containing your ASP scripts must have execute permission, and also write<br />

permission unless the in-core method for generating PDF is used (the supplied ASP<br />

samples use in-core PDF generation).<br />

You can improve the performance of <strong>COM</strong> objects such as <strong>PDFlib</strong>_com on Active Server<br />

Pages by instantiating the object outside the actual script code on the ASP page, effectively<br />

giving the object session scope instead of page scope. More specifically, instead<br />

of using CreateObject (as shown in the example in the next section)<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!