This section provides information about the following:
Loading a Password Protected PDF
To load a password protected PDF refer to Use PDF Security.
Saving as a PDF
ImageGear PDF component provides the ImGearPDFSaveOptions class that defines options for saving raster pages and documents to specific PDF formats like PDF/A. This class is derived from the regular ImGearSaveOptions class and could be used with the regular ImGearFileFormats.SavePage and ImGearFileFormats.SaveDocument methods that take ImGearSaveOptions parameter.
The following sample code demonstrates how to use the ImGearPDFSaveOptions class for saving raster document to PDF/A:
You can also use this approach for converting PDF files to PDF/A which would be effectively the same as using
ImGearPDFPreflight.Convert for the original PDF document.
Reducing File Size when Saving a PDF
In order to reduce the size of a PDF document, use the ImageGear PDF Filter Control Parameters "SaveFlags". For this purpose, combine the following ImGearPDFSaveFlags:
- ImGearPDFSaveFlags.ADD_FLATE
- ImGearPDFSaveFlags.REPLACE_LZW
- ImGearPDFSaveFlags.REMOVE_ASCII_FILTERS
- ImGearPDFSaveFlags.COMPRESSED
- ImGearPDFSaveFlags.OPTIMIZE_XOBJECTS
- ImGearPDFSaveFlags.OPTIMIZE_CONTENT_STREAMS
- ImGearPDFSaveFlags.OPTIMIZE_FONTS
When the
Save Compressed PDF functionality provided in ImageGear is used, you do not need to explicitly set these Save Flags. In this case, the saving operation is executed with these flags activated in order to obtain higher compression rates.
Saving a Password Protected PDF
To save a password protected PDF refer to Use PDF Security.
Saving a PDF as Other Supported Formats
See Convert... for more information.