Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
options.TiffCompression = Aspose.Cells.Rendering.TiffCompression.CompressionCCITT4;
options.HorizontalResolution = 300;
options.VerticalResolution = 300;
options.ImageType = Aspose.Cells.Drawing.ImageType.Tiff;
options.SetDesiredSize(2550, 3100);
options.PrintingPage = PrintingPageType.IgnoreBlank;
Workbook _workbook = new Workbook(File.OpenRead("Stuck tiff Generation 01.xlsx"));
int tiffIndex = 1;
for (int i = 0; i < _workbook.Worksheets.Count; i++)
{
SheetRender sr = new SheetRender(_workbook.Worksheets[i], options);
for (int j = 0; j < sr.PageCount; j++)
{
sr.ToImage(j, Path.Combine(@"Test" + string.Format("_{0:" + "D6" + "}", tiffIndex + 1) + ".tiff"));
tiffIndex++;
}
}
Please provide any solution for batter performance.
You can take file from the Attachment.
Note: After Generation of 1000 tiff It will take to much time, also I don’t have any storage issue or network issue. Stuck in EmbeddedExtractor.zip (4.2 MB)
@hemalp
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-53402
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Because TiffCompression.CompressionCCITT4 is set, it will cost lots of time to convert a colorful image to a black-white image. If possible, please try to comment this line.
On my side, with TiffCompression.CompressionCCITT4 is set, I didn’t see the difference between the cost time of generating tiff images(1-100) and the cost time of generating tiff image(1001-1100).
Since there are thousands of images and converting a colorful image to a black-white image is costing time, the whole conversion needs lots of time.
We need to evaluate it more to see whether there are some faster algorithms to convert a colorful image to a black-white image. However, a faster algorithms may generate a poor black-white image.
If we have some progress, we will update you here.
I am investigating a faster implementation. However, it is unfriendly for background color, the background will be totally white or black. In this case, the cell text may be mixed into the background. e.g. cell text is converted to black color and background is also converted to black color too. Can you accept the result in this case?
Please check the generated first page and screenshot that highlight the difference:FasterResult.zip (1.0 MB)
So to faster result, we have to remove CCIT compression ?
will there is no way, we can generate faster output with CCIT compression for BW TIF creation?
We can provide an option that can generate BW Tiff with CCITT compression if you can accept the result.
Please note the cell text may be mixed into the background. e.g. cell text is converted to black color and background is also converted to black color too.
We will add a new API ImageOrPrintOptions.TiffBinarizationMethod to specify the method used while converting images to 1 bpp format.
So the specified ImageOrPrintOptions will be:
Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
options.TiffCompression = Aspose.Cells.Rendering.TiffCompression.CompressionCCITT4;
//specify Threshold method used while converting images to 1 bpp format
options.TiffBinarizationMethod = ImageBinarizationMethod.Threshold;
options.HorizontalResolution = 300;
options.VerticalResolution = 300;
options.ImageType = Aspose.Cells.Drawing.ImageType.Tiff;
options.SetDesiredSize(2550, 3100, false);
options.PrintingPage = PrintingPageType.IgnoreBlank;
The new feature/enhancement will be included in our upcoming release (Aspose.Cells v23.6) that we plan to release before the end of this week. You will be notified when the next version is released.