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

Free Support Forum - aspose.com

Export Range of Cells in a Worksheet to Image: Text is condensed

Hi,

we are generation “screenshots” as describe here. However, the text in the result is condensed as a condensed font would be used. See the attached PowerPoint file for comparision. On the first slide you can see the original table before our manipulation (we change the text of the placeholders). On the second slide you can see the Image generated by aspose.cells. On the third slide you can see the table of the second slide but this time the image is generated by Excel.

Is there a way to make the result more look like the image generated by Excel?

Best regards
Frank

Hi,

Thanks for your posting and using Aspose.Cells.

Please also give us your source excel file as you have shown in the powepoint screenshots so that we could test this issue at our end and take appropriate action.

We are only working with the excel files, that are embedded in power points. Please use the ones of the attached PPTX (in first post) because they are the “real life” excel files, whose aspose.cells “screenshots” are “buggy”.

Hint: Those embedded excel files aren’t in any way specific. For this thread I created a new PPTX and added three new excel-tables from within PowerPoint.

Please let me know if you need any further information.

Hi,

Thanks for your posting and using Aspose.Cells.

I have attached 3 images i,e jpg, png and emf generated from your sample excel file attached with this post using the latest version: Aspose.Cells
for .NET v8.6.2.2
.

Please let us know if any of it is better or still having the condensed issue. We will then log the ticket in our database for product team consideration and a fix.

Note:
Please remove the .txt extension from the emf image.

Hi,

The image you created is much better than the one I provided. I tried it myself with the newest Java version (8.6.2) and now the image we create looks the same as your image does.

Nevertheless, we are not totally pleased by the result :-). For a better visualisation, I added a screenshot made from within PowerPoint at 400% view scale. The first table shows the image made by Excel / PowerPoint. The second image shows the one made by myself with aspose.cells 8.6.2. There are the following things that (in our eyes) can be better:

  • the font still seems to be a bit condensed
  • the resolution is low
  • left and top marging seems to be a bit smaller (I think I can influence that by using worksheet.getPageSetup().setLeftMargin() with a higher number but didn’t try it yet)

Although the resolution is not the topic of this thread, I would be happy if you can also take a look on it.

Regards,

Frank

Hi Frank,

Thanks for your insight and highlighting the issue precisely and using Aspose.Cells.

We have logged this issue in our database for investigation. We will look into it and improve it so that it could appeal to you if possible. In case, you need some code change we will suggest it to you. Once there is some news or fix for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-41614 - Export Range of Cells in a Worksheet to Image - Text is condensed

Hi Frank,

Thanks for using Aspose.Cells.

Considering page scale and font size may be different as excel rendered,
it is almost impossible that text layout is exactly same as that excel
rendered. So we are unable to fix this issue.

Alright, as a software developer I can absolutely unterstand that.

Please let me ask a last question: Can I increase the resolution of the generated image?

Hi,


Thank you for your understanding.

You may use the ImageOrPrintOptions.HorizontalResolution & VerticalResolution properties to set the desired resolution for the resultant image.

Java

ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setHorizontalResolution(300);
options.setVerticalResolution(300);