Read RichText from Cell as Image Data

Hi Team,


I have an Excel sheet where I have rich text (Bold,Italic,Underline,Bullets etc…). I am trying to read that data as Image and Load that to a PPT Slide.

In this process, the underline part of rich text is being missed. But the other formats (Bold, bullets etc) are being copied fine.

Can you please help me on this? Please let me know if this post needs to be in Slides part of the forum.

Thanks.

Hi,

Well, your scenario has two parts.
1) Using Aspose.Cells to convert an Excel sheet to Image. As you mentioned you have some rich text in the sheet’s cells.
2) Using Aspose.Slides API, you are inserting the image to paste into the slides.

Take the image using Aspose.Cells API, if the image is not the same as shown in MS Excel, please give us your sample code, template file(s) and output image here. We will check your issue soon.

Thank you.

Hi Amjad,

Below is the code am using to read the Cell Value as an Image.

When the rich text is having both Bold and Underline, either one of them is being missed in the output.

Please help me in fixing this.

public static void main(String[] args) {

try{

wb.open("C:\\ExcelTest.xls");

Worksheet sheet = wb.getWorksheets().getSheet(0);

ImageOptions options = new ImageOptions();

options.setPaginate(false);

options.setImageFormat(ImageFormat.PNG);

PageSetup ps = sheet.getPageSetup();

ps.setPrintArea("D9:M10");

ps.setLeftMargin(0);

ps.setRightMargin(0);

ps.setTopMargin(0);

ps.setBottomMargin(0);

SheetRender sr = new SheetRender(sheet, options);

for (int index = 0; index < sr.getPageCount(); index++)

{

sr.toImage(index,"C:\\Test.JPEG");

}

System.out.println("Done!!!");

}catch(Exception e){

e.printStackTrace();

}

}

Hi,

I have tested your case and found the
issue.

I have logged an issue with an id:
CELLSJAVA-25708. We will look into it soon.

Thank you.

Hi Amjad,

Thanks for your response.

This task of mine is kept pending for long time. Your quick revert with the fix would help me in keeping up with the project deadlines.

Thankyou once again.

Hi,

Can you please let me know by when I can hear from you regarding the fix ?

This will help me in handling my project deadline.

Thanks alot for your continuous support.

Hi,

Normally, we provide the bug fixed version within 3-5 days (if it is not complex issue). We are evaluating your issue and will provide the fix soon.

Also, if an issue is more complex, we will provide an eta.

Thank you.

Thats very good of you Amjad.

Thanks alot for taking care of the issue. Will be waiting for your reply :)

Hi,

Please try Aspose.Cells for Java v2.5.2.8, we have fixed your issue now.

Thank you

Hi Amjad,

Thanks alot for Fixing the issue.

But I could not verify the fix by using the jar provided by you. Below Exception is thrown while I was running the example.

Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException

at com.aspose.cells.Workbook.open(Unknown Source)

at TestImage.main(TestImage.java:23)

TestImage.java is the same file which I have already provided in the same forum earlier. Can you please check this?

Also, if you can provide the jar file for Java 1.6, that will be great.

Thanks.

Hi,

You need additional jar libararies. Please read this note.

Here is a direct link to download additional libraries.

Thank you Mr.Faiz

I am able to achieve what I was looking for. The continuous support given by the whole team so far is highly appreciable.

Have a nice time!!

The issues you have found earlier (filed as 25708) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.