Im trying to find a way to convert xls files to pdf, and gembox spreadsheet is great for this. But i need to be able to make it fit to one page as you can when printing to pdf via excel.
Asked
Active
Viewed 1,609 times
1 Answers
2
Try specifying FitWorksheetWidthToPages
and FitWorksheetHeightToPages
properties.
For example like the following:
ExcelFile workbook = ExcelFile.Load("Sample.xls");
ExcelWorksheet worksheet = workbook.Worksheets.ActiveWorksheet;
worksheet.PrintOptions.FitWorksheetWidthToPages = 1;
worksheet.PrintOptions.FitWorksheetHeightToPages = 1;
workbook.Save("Sample.pdf");
I hope this helps.

Mario Z
- 4,328
- 2
- 24
- 38