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

Free Support Forum - aspose.com

Aspose Cell- ToImage function generating extra column in generated image

Hi Team,


We are using aspose cell ToImage function to generate image of excel sheet.

An extra column present in generated image.

Please see below code and attached excel and png file.

MemoryStream inputStream = new MemoryStream(inputExcelData);
inputStream.Position = 0;
Workbook book = new Workbook(inputStream);
Aspose.Cells.Worksheet sheet = book.Worksheets[0];

//Set left, top, right, bottom margins to 0
sheet.PageSetup.LeftMargin = 0;
sheet.PageSetup.RightMargin = 0;
sheet.PageSetup.TopMargin = 0;
sheet.PageSetup.BottomMargin = 0;
sheet.PageSetup.PrintQuality = 100;

ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = ImageFormat.Png;
imgOptions.OnePagePerSheet = true;
imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;
imgOptions.Quality = 100;


MemoryStream imageStream = new MemoryStream();
imageStream.Position = 0;
SheetRender sr = new SheetRender(sheet, imgOptions);
sr.ToImage(activeWorkSheet, imageStream);
Please let me know how to handle this case.

Regards,
Nakul


Hi,

Your output image looks fine to me. I don’t see any problems.

Will you please highlight the problems in a screenshot with red circles. Please also test your issue with the latest version:
Aspose.Cells for .NET v7.0.3.3

Hi,


I have checked with latest version.

See attached file you will find the difference. (See red marked area)

It has an extra generated column.

Thanks and Regards,
Nakul

Hi,

I have logged this issue in our database. We will look into it and fix it and update you asap.

This issue has been logged as CELLSNET-40159.

Hi,


Could you please let me know tentative timeline to get this issue fix.

We are Aspose cell licensed user and we need to move this fix in production soon.

Thanks and Regards,
Nakul

Hi Team,


One more thing we would like to know about Aspose cell ToImage generator.

What is difference between the Image generated by MS Word when we insert an excel document as document in Word and the Image provided by this function.

We are trying to get 100% exact image like we get in word document embedding.
But we are getting difference in image like, font type and bold. Image generated by ToImage are little faint than MS word generated Image.

How we can achieve it? Please let me know.

Thanks in advance.

Regards,
Nakul

Hi,

Normally, the fix takes 2~3 working days. If it is a difficult to resolve, it can take a week or two.

Please post your other problems with images, so that we could also look into them and fix them.

Hi,


I will send you some compared images soon.

Stay tuned.

Thanks,
Nakul

Hi,


Please let me know when I will get fix for extra column in image.

Meanwhile I am in process of sending image comparison for font and style.

-Nakul

Hi ,


Please find attached document for comparison of font style in images generated by word and aspose.

Let me know if you need any details.

Note: Excel sheets are embedded inside word doc.

After double click in aspose generated doc, images are generated by MS word

Thanks and Regards,
Nakul


Hi,

Thanks for your files.



Please highlight the problems with red circles in a screenshot.

Hi,

Please try the latest version:
Aspose.Cells for .NET v7.0.3.6

There is extra space left in the right because the text in the cell U3 exceeds the column.

Please let us know how did you generate a file and also we do not know your last requirement. Can you please elaborate it?

Hi Faiz,


Please find attached file for comparisons.

In new version one extra column is generated and also grid lines are changed

Thanks and Regards,
Nakul


Hi,

Thanks for your files.

As I mentioned earlier, there is extra space left in the right because the text in the cell U3 exceeds the column. Therefore it needs more space when you will take its image.

If you do not want this extra column, please set CellU3 style to wraptext.

Hi Faiz,


If you see image in grid this is an extra column, not free space as you are telling.

Thanks and Regards,
Nakul

Hi,

In our internal code, if text exceeds its own column, the text needs extra right column or columns to show all text. You can adjust right column width to see it.

Hi Faiz,


Any updated from your side for this issue.

Thanks and Regards,
Nakul

Hi,

I will update you soon after some testing.

Hi Nikul,

Please read our replies at the following posts: 349460 and 349497 we think our results are correct.

Please remove the text in U3 and see the difference.

Hi Faiz,


I have checked with dll provided by you.

1) Extra column is not generated but grid lines are changed as I mentioned in last post.
Now it is showing dotted line.

2) As well compare attached the given output file by word and aspose generated file for font weight difference.

I changed image out put to .emf file as word dose.

Please let me know if you need more details.

Thanks and Regards,
Nakul