LEADTOOLS Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.22
Implementing PDF Plugin Features

Overview:

The PDF module enhances the input/output functionality in LEADTOOLS by supporting a number of powerful and complex file formats including:

PDF is emerging as a powerful format for reproducing documents over the web. Because of its high precision and accuracy in representing text and pictures along with its "hyper" nature, PDF is becoming a popular alternative to HTML and Postscript.

Loading Capabilities:

The LEADTOOLS PDF plug-in has the following import capabilities:

  1. Loads essentially all PDF 1.3 (Acrobat 4.x compatible) through PDF 1.6 files.

  2. Loads all PostScript Language Level 3 files.

  3. Loads any EPS file.

The loading support includes multi-threading support and multi-page support, where you can specify which page or range of pages to load from the file.

LEADTOOLS gives the you a number of control options in order to customize the rasterized page. These options include:

  1. Pixel depth. Valid values are 0 (for auto-detect) 1, 4, 8 and 24. The default value for this control parameter is 24.

  2. Horizontal and vertical resolution in dots per inch with a default value of 96 by 96. It is recommended you change these to 300 if your application is loading the PDF files for recognition purposes (OCR or barcode for example) by using CodecsRasterizeDocumentLoadOptions.

  3. Font anti-aliasing. Valid values are 1bit (no anti-aliasing), 2 and 4-bit anti-aliasing. The default value is 1, which gives the sharpest representation of the text in the file.

  4. Graphics anti-aliasing. Valid values are 1bit (no anti-aliasing), 2 and 4-bit anti-aliasing. The default value is 1.

You can use CodecsPdfOptions for control options that are used when loading a file.

You can also use the RasterCodecs.GetRasterPdfInfo method to get information specific to a PDF file on disk or in a stream, such as its original bits/pixel, compression, size and resolution.

Saving Capabilities:

Full multi-page write support is provided by LEADTOOLS for the PDF format. You can append, insert, replace or delete specific pages in a PDF file created by LEADTOOLS.

The plug-in gives you a wide range of control options for the resulting image data in terms of compression, including:

  1. No compression.

  2. Compressed using CCITT Group 3, 1 dimension. For 1-bit images.

  3. Compressed using CCITT Group 3, 2 dimensions. For 1-bit images.

  4. Compressed using CCITT Group 4. For 1-bit images.

  5. JPEG compression and YUV 4:4:4 color space loss-less. Bits per pixel: 8 for grayscale, 24 for color.

  6. JPEG compression and YUV 4:2:2 color space. Bits per pixel: 8 for grayscale, 24 for color.

  7. JPEG compression and YUV 4:1:1 color space. Bits per pixel: 8 for grayscale, 24 for color.

A number of save format constants are provided to support types of files created by LEADTOOLS. For a list of these, please refer to Summary of All Supported Image File Formats.

LEADTOOLS also gives you control over the type of encoding to be used in order to change compressed image data into a text format. The text encoding techniques include:

  1. No text encoding at all.

  2. Use ASCII 85 text encoding algorithm.

  3. Use ASCII HEX text encoding technique.

In order to specify which type of text encoding to use when saving, refer to TextEncoding.

LEAD provides the CodecsPdfOptions.Save property in order to specify which type of text encoding to use when saving and to let you control the security of and access to the PDF file that is saved. These include user and owner passwords, encryption options, and the capabilities the user of the resulting PDF document will have. To determine or set the current options used when saving a PDF file use CodecsOptions.Save.

Distributing an application built using the PDF Module

LEADTOOLS provides support for PDF loading and saving through two DLLs: Leadtools.Codecs.Pdf.dll and Leadtools.PdfEngine.dll.

Leadtools.Codecs.Pdf.dll assembly is the file filter for PDF support in LEADTOOLS. Leadtools.Codecs which contains the LEADTOOLS raster images load and save support will load this assembly dynamically when PDF files are loaded or saved. This is the normal behavior for LEADTOOLS support for any file format.

Leadtools.PdfEngine.dll is the PDF runtime DLL. This DLL is never referenced directly by the LEADTOOLS Raster PDF file filter (Leadtools.Codecs.Pdf), instead it is loaded dynamically and out of process by the filter.

By default, the LEADTOOLS installer will copy this DLL next to the filter (in the Bin\DotNet\Win32, Bin\DotNet\x64, Bin\DotNet4\Win32 and Bin\DotNet4\x64 folders) and the filter will look for the engine DLL in the same folder it is located (default location).

In some cases, you can share the same copy of Leadtools.PdfEngine.dll between different applications. For example, many ASP.NET web applications, in this case, you can copy Leadtools.PdfEngine.dll to a fixed directory on your server and pass the name of this directory to InitialPath. From this point on, LEADTOOLS will use this value to locate and load Leadtools.PdfEngine.dll.

In addition to these DLLs, LEADTOOLS might require the use of other DLLS when saving PDF file depending on the compression used. For more information, refer to Files To Be Included With Your Application.