Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Jun 23, 2020 8:48 am

I am trying to load a existing xlsx file to save it as a pdf file:

Code: Select all
Workbook workbook = new Workbook();
workbook.LoadFromFile(fileInfo.FullName);
workbook.SaveToFile(Folder + "Mappe.pdf", Spire.Xls.FileFormat.PDF);


Inside a Windows Terminal Application everything looks fine, but if I copy the code into a Windows Service Application I am getting a "System.NullReferenceException" from LoadFromFile. My Excel Sheet contains a small jpg-Image with the following size 600x400. My Excel-sheet is only 66kB. Without the jpg-Image it works :(

MeerArtefakt
 
Posts: 6
Joined: Tue Jun 23, 2020 8:30 am

Tue Jun 23, 2020 9:23 am

Hello,

Thanks for your inquiry.
I simulated an Excel file and tested your case with the latest Spire.XLS Pack(Hotfix) Version:10.5.7 but did not encounter any issue. To help us investigate your issue more accurately, please share your input file with us. You could send it to us(support@e-iceblue.com) via email.
Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Jun 23, 2020 9:44 am

Email is on the way :)

MeerArtefakt
 
Posts: 6
Joined: Tue Jun 23, 2020 8:30 am

Tue Jun 23, 2020 10:23 am

Hello,

Thanks for your sharing via email.
I tested your file but found it can be successfully converted to PDF. The following is my testing project, which uses the latest Spire.XLS Pack(Hotfix) Version:10.5.7. Please run it on your side.
http://www.e-iceblue.com/downloads/demo/21981Demo.zip

If the issue still occurs, please tell us your OS information (E.g. Windows 7, 64 bit) and region setting (E.g. China, Chinese) for further investigation. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Jun 24, 2020 5:18 am

Dear Rachel,

thank you for your quick support. Everything is okay, your testing project works well. Something in my project was confused, sorry!

MeerArtefakt
 
Posts: 6
Joined: Tue Jun 23, 2020 8:30 am

Wed Jun 24, 2020 5:39 am

Hello,

Thanks for your feedback.
If you encounter any question related to our product in the future, just feel free to contact us.
Wish you all the best!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS