Hi,
I would like to have support from your side, because I am trying to convert jpg, bmp, gif and png file types to tiff files with ccitt4 compression. Attached file are the Input, and Output file. Also, I am using VS2010, Framework 4, and Imaging V.1.5.
I really appreciate your help.
Thank you,
Danilo Ac
This is the currently source code I am using:
string filepath = "C:\\Taspose\\testimaging.JPG";
string fileoutput = "C:\\Taspose\\page2out.tiff";
System.IO.MemoryStream outStream = new System.IO.MemoryStream();
if (filepath != string.Empty)
{
try
{
Aspose.Imaging.License LIC = new Aspose.Imaging.License();
LIC.SetLicense("C:\\TAspose\\Aspose.total.lic");
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(filepath))
{
//Get the saveOptions according to the value selected from dropdownlist
Aspose.Imaging.SaveOptions.TiffSaveOptions saveOptions = new Aspose.Imaging.SaveOptions.TiffSaveOptions();saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.CcittFax4;
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
saveOptions.BitsPerSample = 1;
saveOptions.SamplesPerPixel = 1;
//saveOptions.Xresolution = Convert.ToInt32(PDFResolution);
//saveOptions.Yresolution = Convert.ToInt32(PDFResolution);
//Save the image
image.Save(fileoutput, saveOptions);
image.Save(outStream, saveOptions);
}
//convert the MemoryStream to Byte array
Byte[] bytes = outStream.ToArray();
outStream.Close();
//Prepare the Response to output the file
/*Response.Clear();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment; filename=output." + this.ddlSaveType.SelectedItem.Value.ToLower());
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(bytes);
Response.End(); */
}
catch (Exception ex)
{
LabelError.Text = ex.Message;
LabelError.ForeColor = System.Drawing.Color.Red;
}
}