Loading of remote images not working after encrypting with Aspose cells

Hi guys,


I reported similar problem earlier and it was fixed in one of the relases of Aspose cells. This was tested with Aspose cells 7.4.2 (latest version).

When I try to set password to demo.xlsx file and to save it under new name - final.xlsx, loading of remote image is not working any more. Remote image is loaded from address:

http://milos.malovic.net/images/piksel.png

In attachment you can find demo example.

Our company is licenced user of Aspose cells and we have paid support in this year.

Hi,


I could not find the issue, both demo.xlsx and final.xlsx (after using your sample code with input file) have the linked image, see the screenshot of the output file taken with Selection and Visibility pane. However, I have waited a bit, for both files (demo.xlsx and final.xlsx), I could not spot the image in the first sheet though, my internet connection is working fine. Could you give us more details, maybe you may provide us the screen shot taken from the input and output files, we will further investigate the issue.

Thank you.

Hi Amjad,


In attachment you can find screenshots with logs from my web server.

- shot.png is when I open demo.xlsx file. As you can see, HTTP request for loading remote image is sent.

- shot2.png is from encrypted file in Aspose cells. As you can see, HTTP request for loading remote image was not sent.

- shot3.png is from encrypted file in Microsoft Excel. As you can see, HTTP request to the server is sent when user opens document and enters correct password.

Hi,


Thanks for providing us screen shots.

I have logged a ticket with an id “CELLSJAVA-40494” for your issue. We need to investigate it thoroughly if there is something to do with our product or not. Our concerned developer will look into it soon.

Once we have any update on it or we sort it out, we will let you know here.

Thank you.

Hi,


We have investigated your issue a bit.

We think it may not be an issue with Aspose.Cells. To confirm this, we actually changed the size of the picture in your template file and linked source of the picture in the source XML file. We renamed your template file as “demo_new.xlsx”. Now I have used the following sample code with the Aspose.Cells, the output file is fine and the image is displayed fine on the sheet. Please find attached the input and output files here for your reference.

Sample code:

// open input and output stream
FileInputStream fis = new FileInputStream( new File( “demo_new.xlsx” ) );
FileOutputStream fos = new FileOutputStream( new File( “final_new.xlsx” ) );
// open workbook
Workbook workbook = new Workbook( fis );
// set password
workbook.getSettings().setPassword( “demo” );
// save document
workbook.save( fos, SaveFormat.XLSX );
// close streams
fis.close();
fos.close();

Thank you.

Hi Amjad,


I opened files demo_new.xlsx and final_new.xlsx in Microsoft office and noone of those files is sending HTTP request to milos.malovic.net. I checked server logs and there is nothing there. My original unencrypted file (demo.xlsx) works fine.

Hi,


Well, the demo_new.xlsx file is manually edited and we renamed it, so it should also work fine on your server. The final_new.xlsx file is actually re-saved by Aspose.Cells API. We still suspect the issue may not be related to Aspose.Cells and it might be due to your network or HTTP / HTTP compression issue on your environment.

Could you try to test your issue on some other stand alone machines and some other environments and let us know your feedback.

Thank you.

Hi,

Please check attached template file and the resultant file generated by Aspose. Cells. We Simply modified your original "demo.xlsx” by replacing the image “http://milos.malovic.net/images/piksel.png” with “http://milos.malovic.net/images/sugestije.png” and resizing it to make it visible for testing purpose and saved it as “demo_new.xlsx”. Open it in MS Excel, we can see the image is shown fine. Then we use your code to encrypt the Workbook and re-save it as “final.xlsx”. Open “final.xlsx” in MS excel, we also can see the image is shown fine. For both files, we can confirm the http request has been sent, otherwise the image cannot be shown in Excel.

Thank you.

Hi Amjad,


After checking your example, I looked in the code where I insert remote image into excel document and put for start column 0 and end column 1 (instead of 0) of the image element and after this change everything worked perfect.

Thank you very much for the support.

Hi,

Thanks for your posting and using Aspose.Cells.

It is good to know your issue is resolved now. If you face any other issue, please feel free to post on forums, we will be glad to help you more.