Type Default Value Read Only Description

[Visual Basic]
  None No The preferred compression method.




This property determines the preferred compression method.

Not all file formats support all compression methods. Not all compression methods support all color spaces. This is why this property indicates a preferred method.

The Compression enumeration accepts the following values:

  • None [Uncompressed]
  • G3 [G3 Black and White Fax Compression]
  • G4 [G4 Black and White Fax Compression]
  • LZW [LZW Compression]
  • Jpeg [Tiff Jpeg Compression]
  • AdobeFlate [Adobe Flate Compression]
  • Flate [Flate Compression]
  • PackBits [Macintosh PackBits]

In general this property is most useful when producing output in formats like TIFF which support a range of color spaces and compression methods.




The following example shows how to render a PDF into a multipage G4 compressed Fax TIFF using different vertical and horizontal resolutions.

Doc theDoc = new Doc();
// set up the rendering parameters
theDoc.Rendering.ColorSpace = XRendering.ColorSpaceType.Gray;
theDoc.Rendering.BitsPerChannel = 1;
theDoc.Rendering.DotsPerInchX = 200;
theDoc.Rendering.DotsPerInchY = 400;
// loop through the pages
int n = theDoc.PageCount;
for (int i = 1; i <= n; i++) {
  theDoc.PageNumber = i;
  theDoc.Rect.String = theDoc.CropBox.String;
  theDoc.Rendering.SaveAppend = (i != 1);
  theDoc.Rendering.SaveCompression = XRendering.Compression.G4;

[Visual Basic]
Dim theDoc As Doc = New Doc()
' set up the rendering parameters
theDoc.Rendering.ColorSpace = XRendering.ColorSpaceType.Gray
theDoc.Rendering.BitsPerChannel = 1
theDoc.Rendering.DotsPerInchX = 200
theDoc.Rendering.DotsPerInchY = 400
' loop through the pages
Dim n As Integer = theDoc.PageCount
For i As Integer = 1 To n
  theDoc.PageNumber = i
  theDoc.Rect.String = theDoc.CropBox.String
  theDoc.Rendering.SaveAppend = (i <> 1)
  theDoc.Rendering.SaveCompression = XRendering.Compression.G4