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

Free Support Forum - aspose.com

When converted to PDF, the images in the Excel file disappear

I developed function in the environment below.
Window10 64bit .
Cells 22.12.
Java 1.8.0_291
Tomcat 7.0

No problem, workbook.The save (“xxxx.pdf”) command worked well.

However, on the server, It is saved without the images.
The server environment is as follows.
Window Server 2016 64bit
Cells 22.12.
Java 1.8.0_291
Tomcat 7.0

Please, I want to know the cause.

@dark0828,

Thanks for the details.

Could you please zip and attach your input Excel file and output PDFs generated (by Aspose.Cells) on both environments. We will check it soon.

ToPDF.7z (50.8 KB)

Please refer to the above file.

@dark0828
1,Please comfirm the image : serverRootPath + “fileupload/scheduler/Stamp.png”; exist on the server.
2,Please save it as xlsx before saving pdf on the server and share it here.

  1. ToPDF\FilE\Stamp.PNG
  2. ToPDF\FilE\test_topdf_2.xlsx

Before I ran the program, I put the file on the path and ran it.
The system worked fine in the local environment. However, when running on Windows Server, it ran without an image.

I’ll give you additional information.

The Windows Server 2016 server PC cannot connect Internet (closed network)
Office 2016 is installed.

A simple code is missing the image here.
Workbook workbook = new Workbook(“C:/Temp/Test.xlsx”);
workbook.save(“C:/Temp/Test.pdf”, SaveFormat.PDF);
workbook.save(“C:/Temp/Test.html”, SaveFormat.HTML);

Please let me know if there is any Os configuration that Aspose works normally.
C:/Temp/Test.xlsx : XLSX.PNG (9.2 KB)
Result C:/Temp/Test.pdf : PDF.PNG (22.0 KB)
Result C:/Temp/Test.html : HTML.PNG (7.8 KB)

@dark0828,

Thanks for the screenshots.

It looks like the image is not there on the specified path onto the server. So, kindly make sure the PNG image is there and there should be no rights issue (application should have read & write permissions to access the folder which contains the image).

Moreover, as requested earlier, please add a few lines of code (as following) to save to xlsx before saving pdf on the server and share the output XLSX file here:

....
String saveExcelFilePath = serverRootPath + "fileupload/scheduler/result_toxlsx.xlsx";
String savePDFFilePath = serverRootPath + "fileupload/scheduler/result_topdf.pdf";
workbook.save(saveExcelFilePath);
workbook.save(savePDFFilePath, SaveFormat.PDF);