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.

Thu Dec 03, 2020 9:31 am

Hello,

we used the following approach to convert Excel workbook to PDF - https://www.e-iceblue.com/Tutorials/Spire.XLS/Spire.XLS-Program-Guide/Convert-Excel-to-PDF-in-WPF.html

After we upgraded Spire.Office for .NET to version 5.12 we got the following compilation error:

The type or namespace name 'Converter' does not exist in the namespace 'Spire.Xls'.

Which is the new way to convert Excel workbook to PDF using template?

Regards

profiler007
 
Posts: 72
Joined: Wed Nov 13, 2019 11:32 am

Thu Dec 03, 2020 10:37 am

Hello,

Thanks for your inquiry.
Please use this new way to convert Excel to PDF. If there are any questions, just feel free to contact us.

Code: Select all
            Workbook workbook = new Workbook();
            workbook.LoadFromFile("test.xlsx");
            foreach (Worksheet worksheet in workbook.Worksheets)
            {
                worksheet.PageSetup.Orientation = PageOrientationType.Landscape;
                worksheet.PageSetup.PaperSize = PaperSizeType.PaperA4;
            }

            workbook.SaveToFile("123.pdf",Spire.Xls.FileFormat.PDF);


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Thu Dec 03, 2020 12:41 pm

Works fine, thanks!

profiler007
 
Posts: 72
Joined: Wed Nov 13, 2019 11:32 am

Fri Dec 04, 2020 3:19 am

You are welcome.
If you encounter any issues related to our products in the future, please feel free to contact us.
Wish you all the best!

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.XLS