17.05.2014 Views

PDFlib Text Extraction Toolkit (TET) Manual

PDFlib Text Extraction Toolkit (TET) Manual

PDFlib Text Extraction Toolkit (TET) Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.6 .NET Binding<br />

The .NET edition of <strong>TET</strong> supports all relevant .NET concepts. In technical terms, the<br />

<strong>TET</strong>.NET edition is a C++ class (with a managed wrapper for the unmanaged <strong>TET</strong> core library)<br />

which runs under control of the .NET framework. It is packaged as a static assembly<br />

with a strong name. The <strong>TET</strong> assembly (<strong>TET</strong>_dotnet.dll) contains the actual library<br />

plus meta information.<br />

Note <strong>TET</strong>.NET requires the .NET Framework 2.0 or above.<br />

Installing the <strong>TET</strong> Edition for .NET. Install <strong>TET</strong> with the supplied Windows MSI Installer.<br />

The <strong>TET</strong>.NET MSI installer will install the <strong>TET</strong> assembly plus auxiliary data files, documentation<br />

and samples on the machine interactively. The installer will also register <strong>TET</strong><br />

so that it can easily be referenced on the .NET tab in the Add Reference dialog box of Visual<br />

Studio .NET.<br />

Installing <strong>TET</strong>.NET for ASP.NET. In order to use <strong>TET</strong>.NET in your ASP.NET scripts you<br />

must make the <strong>TET</strong>.NET assembly available to ASP. This can be achieved by placing<br />

<strong>TET</strong>lib_dotnet.dll in the bin subdirectory of your IIS installation (if it doesn’t exist you<br />

must manually create it), or the bin directory of your Web application, e.g.<br />

C:\Inetpub\wwwroot\bin\<strong>TET</strong>_dotnet.dll<br />

C:\Inetpub\wwwroot\WebApplicationX\bin\<strong>TET</strong>_dotnet.dll<br />

or<br />

Special considerations for ASP.NET. When using external files ASP’s MapPath facility<br />

must be used in order to map path names on the local disk to paths which can be used<br />

within ASP.NET scripts. Take a look at the ASP.NET samples supplied with <strong>TET</strong>, and the<br />

ASP.NET documentation if you are not familiar with MapPath. Don’t use absolute path<br />

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

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

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

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

Trust levels in ASP.NET 2.0 and above. ASP.NET 2.0 introduced some restrictions regarding<br />

the allowed operations in various trust levels for Web applications. Since<br />

<strong>TET</strong>.NET contains unmanaged code, it requires Full Trust level. <strong>TET</strong>.NET applications cannot<br />

be deployed in ASP.NET 2.0 applications with any other trust level, including High<br />

or Medium Trust.<br />

Error handling. <strong>TET</strong>.NET supports .NET exceptions, and will throw an exception with a<br />

detailed error message when a runtime problem occurs. The client is responsible for<br />

catching such an exception and properly reacting on it. Otherwise the .NET framework<br />

will catch the exception and usually terminate the application.<br />

In order to convey exception-related information <strong>TET</strong> defines its own exception<br />

class <strong>TET</strong>_dotnet.<strong>TET</strong>Exception with the members get_errnum, get_errmsg, and get_apiname.<br />

3.6 .NET Binding 27

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

Saved successfully!

Ooh no, something went wrong!