CCITT (Fax format) images are also supported by Aspose.Pdf . Developers can use these images to add in the PDF documents too. CCITT images are sub-divided into groups like Group-3 and Group-4 despending upon their compression techniques. Aspose.Pdf supports these groups of CCITT images also.
Aspose.Pdf considers these groups of CCITT as its sub-formats. Aspose.Pdf provides an enumeration, CcittSubFormat having pre-defined Sub-Formats of CCITT images as follows:
CCITT Sub-Formats |
Description |
Group31D |
CCITT Group-3 1D format |
Group32D |
CCITT Ggroup-3 2D format |
Group4 |
CCITT Group-4 format |
UnKnown |
Unknown |
To specify CCITT Group, Aspose.Pdf offers ImageInfo.CcittSubFormat property in Image class. We can assign any desired value to ImageInfo.CcittSubFormat property from the pre-defined values in CcittSubFormat enumeration.
When using CCITT image, you should also specify the ImageWidth and ImageHeight properties of the Image class too.
Example:
[C#]
//Instantiate an image object
Image img1 = new Image();
//Set the path of image file
img1.ImageInfo.File = "E:/images/Bag11083_X_G31D.fax";
//Set the file type of the image
img1.ImageInfo.ImageFileType = ImageFileType.Ccitt;
//Set the image width
img1.ImageInfo.CcittImageWidth = 2560;
//Set the image height
img1.ImageInfo.CcittImageHeight = 1779;
//Set the sub-format of the ccitt image
img1.ImageInfo.CcittSubFormat = CcittSubFormat.Group31D;
//Set the desired scaling of the image
img1.ImageScale = 0.1F;
[VB.NET]
'Instantiate an image object
Dim img1 As Aspose.Pdf.Image = New Aspose.Pdf.Image()
'Set the path of image file
img1.ImageInfo.File = "E:/images/Bag11083_X_G31D.fax"
'Set the file type of the image
img1.ImageInfo.ImageFileType = ImageFileType.Ccitt
'Set the image width
img1.ImageInfo.CcittImageWidth = 2560
'Set the image height
img1.ImageInfo.CcittImageHeight = 1779
'Set the sub-format of the ccitt image
img1.ImageInfo.CcittSubFormat = CcittSubFormat.Group31D
'Set the desired scaling of the image
img1.ImageScale = 0.1F
[XML]
<Image File="E:/images/Bag11083_X_G31D.fax" Type="ccitt" Width="2560"
Height="1779" CcittSubFormat="Group31D" ImageScale="0.1" />