Reading and writing support for PDF formats is included in the following Imaging SDK products:

  • Imaging SDK for WindowsDLL
  • Imaging SDK for the Java Platform

Currently, RasterMaster does not provide PDF reading support in UNIX and Macintosh products. RasterMaster does provide PDF writing support for its UNIX and Macintosh products.

PDF reading is available as a separate option. For the Imaging SDK for Java, a special PDF version is available. For the other products, the pdfplug.dll file is required for PDF reading support. You can also include the file in the \Windows\system directory.

Reading or Decompressing a PDF Document

To read in or decompress a PDF document, use any of the decompression calls such as IMG_decompress_bitmap(String, int). All Imaging SDK products automatically detect the file format and do not use the extension on the file name.

The default size for decompressing PDF documents is 200 dots per inch (DPI) and 24 bits per pixel. To alter this or to convert PDF files, you can call the IMGLOW_set_pdf_input(int, int) method.

Saving to a PDF Document

Imaging SDK products support writing PDF files. To save a file as PDF, use any of the saving calls such as IMG_save_bitmap() with the file format set to PDF or the file type constant number 59.

RasterMaster Java can save to two different types of PDF files; raster PDF and vector PDF. IMG_save_bitmap(byte, int, int, int) saves a rasterized PDF with high fidelity rendering. IMG_save_document(byte, byte, int) outputs a vector PDF with text that can be searched so vector PDF is also known as searchable PDF. Currently, the text output is limited to ASCII.

Working with Black and White Images

If you are working with black and white documents, you will save a lot of memory and increase performance by setting the DPI to 300 or 200 and the bits per pixel to 1 when reading PDF images. For 1-bit or black and white images, will write out or save a PDF with CCITT - G4 compression for black and white images. For more information on improving performance, please see Improving Performance in Improving Performance or Quality.

Working with Color Images

For color bitmaps, a PDF will be created with JPEG compression.

Changing Output Page Size

The default page size is set to 8.5 x 11. The bitmap image saved is centered at this page. To alter the output page size, use the call the IMGLOW_set_pdf_output(int, int) method. The xsize and ysize parameters are the page size in points or 1/72 of an inch.

Performance

If you are working with black and white documents, you will save a lot of memory and increase performance by setting the DPI to 300 or 200 and the bits per pixel to 1 when reading all document formats. For more information on improving performance, please see Improving Performance in Improving Performance or Quality.

Methods Used for Vector PDF

The The VectorPDF sample demonstrates how to use vectorPDF. You can find the samples in the [RM Java install dir]\Samples\com\snowbound\samples directory. The methods used in this sample include:

  • IMG_decompress_bitmap(String, int) reads in a document in any format and converts it to a valid RasterMaster image. It displays the current image, corrected for aspect ratio, at the current X and Y coordinates.
  • IMG_display_bitmap_aspect(java.awt.Graphics,java.awt.Container, int, int, int, int, int) displays the current image, corrected for aspect ratio, at the current X and Y coordinates.
  • IMG_print_bitmap(java.awt.Graphics, int, int, int, int, int) prints the current image at the specified coordinates.

For the full method reference, please see the RasterMaster Java API.