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.

Sun Nov 10, 2019 5:18 pm

I am creating an excel spreadsheet programmatically (vb.net) using closedxml and after saving the xlsx file, converting to PDF using Spire.

The Spire code simply includes loading the xlsx and then saving as PDF:

workbook.loadfromfile(<FilePath>)
workbook.savetofile(<FilePath>, Spire.Xls.FileFormat.PDF)

There is something happening to the cell width -- its no more than 10 px but after converting, the entire document seems to be pushed slightly to the left. I have done some searching on the forum -- so far I have tried:

workbook.convertersetting.iscellautofit = (True and False) -- no effect good/bad

Margins are not custom in the xlsx and I tried troubleshooting by using print to PDF on the xlsx itself and this does not happen... Not sure if important but there is an image on the xlsx and this anomaly does not affect the image...

Any Suggestions?

Thank you.

mrmizzler
 
Posts: 2
Joined: Sun Nov 10, 2019 5:07 pm

Mon Nov 11, 2019 2:05 am

Hi,

Thanks for your inquiry.
I firstly suggest you try to use Spire.XLS Pack(Hotfix) Version:9.11.2 which has more improvements than old version.
If the issue still exists, please provide the input Excel and output PDF for further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Nov 13, 2019 2:03 am

Hi Betsy,

I am currently using FreeSpire.xls -- does the hotfix work for FreeSpire?

Thank you,

Carmine

mrmizzler
 
Posts: 2
Joined: Sun Nov 10, 2019 5:07 pm

Wed Nov 13, 2019 2:10 am

Hi,

The version 9.11.2 is commercial version. Since we update free version irregularly and the fixes and new features will be included in the latest commercial version firstly, I suggest you try to use the latest commercial version. If the issue still exists, please provide the input Excel and output PDF for further investigation.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Nov 13, 2019 1:51 pm

dear sir/madan
can you help for solving this error "Object reference not set to an instance of an object Error in calculating cell A16 in Worksheet 1' "
The error is on sheet.saveToPdf line, it stops and pop up the above error.

this is my code/

Spire.Xls.Workbook workbook = new Spire.Xls.Workbook();
workbook.LoadFromFile("C:/Users/User1/Desktop/t2.xls");
Spire.Xls.Worksheet sheet = workbook.Worksheets[11];
sheet.SaveToPdf(@"raporlama1", Spire.Xls.FileFormat.PDF);

I will be glad for helping

hafizullah.ozgur
 
Posts: 7
Joined: Wed Nov 13, 2019 1:28 pm

Thu Nov 14, 2019 3:14 am

Hi,

Thanks for your inquiry.
Please provide your input file for further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.XLS

cron