We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert worksheet To Image - Image not Rendered well

Hi,

PFA the below Excels , While converting the below excels to Images "The header 1" does not appear in the image,While the source sheet has the Header 1.

Then the Charts borders in the images are not rendered well . The Top borders and left borders.

The Header and Border missing part has been highlighted in red in the Attached images.

Here is the code to convert to Images

Aspose.Cells.Workbook book = new Aspose.Cells.Workbook("C:\\A.xlsx");

Aspose.Cells.Worksheet sheet;

Aspose.Cells.Rendering.ImageOrPrintOptions imgOptions;

Aspose.Cells.Rendering.SheetRender sr;

Bitmap bitmap;

string number = "";

string[] name = new string[100];

imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();

for (int i = 0; i < book.Worksheets.Count; i++)

{

sheet = book.Worksheets[i];

imgOptions.HorizontalResolution = 118;

imgOptions.VerticalResolution = 112;

imgOptions.OnePagePerSheet = true;

imgOptions.IsImageFitToPage = true;

imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;

sr = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);

if (i < 10)

{

number = "00" + i.ToString();

}

else if (i >= 10 && i < 100)

{

number = "0" + i;

}

else

{

number = i.ToString();

}

bitmap = sr.ToImage(0);

bitmap.Save("C:" + "\\sheetimage" + number + ".tiff");

}

And is there any Possibility to increase the quality of the rendered image ,though the Imageoptions.Quality attribute doesnt increase the quality of the image.

Appreciate your help in this regard.

Thanks,

Abdul R Sha

Hi,

Thanks for the sample files.

I can find the following issues:

1) Header 1 (text) from the A.xlsx file is not rendered in the image.

2) Charts with borders are not rendered fine (H.xlsx).

Regarding colors for headers, I could not find the issue, it works fine with latest version/fix v7.0.3.3.

I have logged a ticket with an id: CELLSNET-40150. We will look into soon.

Thank you.

Hi,

We fixed this issue, please download: Aspose.Cells for .NET v7.0.3.4

Hi

PFA the ImageIssues.xlsx, When i tried converting this workbook to Images , The Images are not properly rendered. I have attached all the Images as a zip file and also have attached a word document to describe the issues in Images. This issue is very critical for us ,So can u please specify the ETA fix for the issue.

Thanks.

Hi,


I have reopened your issue. I can notice the issue regarding conditional and other formattings. We will look into it soon.

Thank you.

Hi Amjad,

Can you please give us a tentative date or a status update for this fix.

This will help me set expectations with the client appropriately. The client is waiting on us to implement the fixes ASAP.

A Quick reply will be of great help. Thank you.

Hi,


I am afraid the issue is not resolved yet. You may try our latest version: Aspose.Cells for .NET v7.0.3.6 in which we made further improvements but your issue might be not be fully resolved. Once we have any update we will share it here. If it takes longer time, we will try to provide you the eta for it.

Thank you.

Hi,

We are fixing the issues you mentioned and will provide a fix before next Friday.

Hi,

We understand that you have provided an ETA for this issue .but we are deadlock in this situation as without fixing the issue we don't find our project going ahead. Kindly look into this issue asap, without fixing this issues , its hard to fit aspose.cells in our project. Kindly do the needful.

Thanks.

Hi,

I have requested the development team to fix this issue as early as possible. I have also logged your comment in our database. Hopefully, the issue will be fixed soon.

Hi,

We have fixed this issue. Please download: Aspose.Cells for .NET v7.0.4.2

Hi,

This DLL has not fixed all issues, can you please tell us if they all showed fixed at your end.

Hi,


Could you give us your input Excel file and output image(s) to show the issue with sample code. Also, give us screen shots to show the problematic areas with red color. We will check it soon.

Thank you.

Hi PFA the Input Excel and the Images attached. Have also attached the Screenshots for your reference and have highlighted the Areas with red which describes the actual problem.Appreciate your help.

Thanks,

Abdul R Sha.

Hi,

Thanks for the files.

I can find the issues using your new template file as mentioned in your attached docx file ("ExcelIssuesScreenshots.docx"-screen shots).

Sample code:

Aspose.Cells.Workbook book = new Aspose.Cells.Workbook("e:\\test2\\ExcelIssuesJan2.xlsx");

Aspose.Cells.Worksheet sheet;

Aspose.Cells.Rendering.ImageOrPrintOptions imgOptions;

Aspose.Cells.Rendering.SheetRender sr;

Bitmap bitmap;

string number = "";

string[] name = new string[100];

imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();

for (int i = 0; i < book.Worksheets.Count; i++)
{

sheet = book.Worksheets[i];

imgOptions.HorizontalResolution = 118;

imgOptions.VerticalResolution = 112;

imgOptions.OnePagePerSheet = true;

imgOptions.IsImageFitToPage = true;

imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;

sr = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);

if (i < 10)
{

number = "00" + i.ToString();

}

else if (i >= 10 && i < 100)
{

number = "0" + i;

}

else
{

number = i.ToString();

}

bitmap = sr.ToImage(0);

bitmap.Save("e:" + "\\test2\\convv\\qsheetimage" + sheet.Index + number + ".tiff");

}

I have reopened your issue now, we will look into it soon.

Thank you.

Hi,

Our Project is going Live on 23rd jan.So i request you to Solve the issue before jan 16th. And We need a confirmation that this Chart to image rendering issues will not repeat again with the fix you provided with the templates that we shared. also we need some more clarifications on the topics listed below.
i) What is the root cause of the Chart issues which was not rendered properly in the images.
ii) Is the Chart to image issues feasible or not ?

So its always better to fix the issue before this date(Jan16th) so that we have some time to test and validate the results and appropriately come back to you if it has some more unexpected bugs after this Fix.Appreciate your help.

Thanks.

Hi,


I have asked the concerned developer to update on the issues. We will get back to you in the early next week. Also, we will clarify about your concerns.

Thank you.

Thank you Amjad,

Our intention in understanding the root cause for all these issues is to make sure these issues will not repeat for similar templates created in future. Please confirm.

Hi,

Please try the latest version/fix v7.0.4.8.

We solved number of issues you mentioned and the others are not supported now. You may modify the template file to generate better results.

See the attachment for your reference.

Hi ,

We tried using your new dll.(7.1.0.0). though it solved some issues it created new issues.PFA the image file for more details. An extra date part getting added to the bottom of the image.This issue really stops our implementation plan.so kindly resolve it as soon as possible.And kindly provide the root cause for the issues that you fixed. we desparately need the root cause of the issues that were fixed.Kindly do the needfull.