PdfCompressor Class |
Namespace: SelectPdf.Compressor
The PdfCompressor type exposes the following members.
Name | Description | |
---|---|---|
PdfCompressor |
Instantiates the PdfCompressor object.
|
Name | Description | |
---|---|---|
DocumentInformation |
PDF document information. Most of this property info is populated after Load. Some info is populated after Save.
(Inherited from PdfManager.) | |
ImagesCompressionEnabled |
Gets or sets a flag indicating if the images compression is enabled or not for the images in the pdf document.
| |
ImagesCompressionLevel |
Gets or sets the compression level of images in the generated pdf document. This is a value between 0 - no compression, 100 - best compression.
| |
RemoveDuplicateFonts |
Gets or sets a flag indicating if the duplicated fonts are removed or not from the pdf document.
| |
RemoveUnusedFontGlyphs |
Gets or sets a flag indicating if the unused font glyphs are removed or not from the pdf document.
| |
StreamsCompressionLevel |
This property controls the compression level of the pdf document.
| |
StructureCompressionEnabled |
Gets or sets a flag indicating if the full compression is enabled or not for the pdf document.
|
Name | Description | |
---|---|---|
Close |
Closes the opened pdf document.
(Inherited from PdfManager.) | |
Load(Byte) |
Loads a pdf document from a byte array.
(Inherited from PdfManager.) | |
Load(Stream) |
Loads a pdf document from the specified stream.
(Inherited from PdfManager.) | |
Load(String) |
Loads a pdf document from an existing pdf file.
(Inherited from PdfManager.) | |
Load(Byte, String) |
Loads a password protected pdf document from a byte array.
(Inherited from PdfManager.) | |
Load(Stream, String) |
Loads a pdf document from a stream containing a password protected pdf document.
(Inherited from PdfManager.) | |
Load(String, String) |
Loads a pdf document from an existing password protected pdf file.
(Inherited from PdfManager.) | |
Save |
Saves the pdf document as byte array.
(Inherited from PdfManager.) | |
Save(Stream) |
Saves the pdf document to the specified stream.
(Inherited from PdfManager.) | |
Save(String) |
Saves the pdf document to the specified file.
(Inherited from PdfManager.) |
// existing PDF document string file = @"C:\path\to\document.pdf"; // load existing file SelectPdf.Compressor.PdfCompressor compressor = new SelectPdf.Compressor.PdfCompressor(); compressor.Load(file); // set compression options compressor.StreamsCompressionLevel = SelectPdf.Compressor.PdfCompressionLevel.BestCompression; compressor.StructureCompressionEnabled = true; compressor.RemoveDuplicateFonts = true; compressor.RemoveUnusedFontGlyphs = true; compressor.ImagesCompressionEnabled = true; compressor.ImagesCompressionLevel = 20; // save compressed document compressor.Save(file + "-compressed.pdf");