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 Oct 15, 2019 7:41 am

Dear E-ICEBLUE company,In my company, I must convert excel file (.xlsm, .xlsx) to pdf file but excel file has size very big, about 30Mb, and have a lot of sheet. Can I convert all sheet to 1 PDF file in 1 time. And maybe convert 2 or 3.. file excel to 1 pdf file?
If this software can covert, which software I must buy (Spire.XLS , Spire.PDF .. and version of it)

NguyenHuong
 
Posts: 2
Joined: Tue Oct 15, 2019 7:31 am

Tue Oct 15, 2019 10:08 am

Hi,

Thanks for your inquiry.
1. Kindly note that when you convert an Excel file to Pdf file, all of the sheets in the Excel file will be converted to one Pdf file automatically. And below is the code for your reference.

Code: Select all
            Workbook wb = new Workbook();
            wb.LoadFromFile(@”……\filename.xlsx");
            wb.SaveToFile("result.pdf",FileFormat.PDF);


2. If you want to convert several Excel files to one Pdf file. You could merge them first, then convert the merged Excel file to one Pdf file. Please refer to the code below.

Code: Select all
            Workbook newbook = new Workbook();
            newbook.Version = ExcelVersion.Version2013;
            newbook.Worksheets.Clear();

            Workbook tempbook = new Workbook();
            string[] excelFiles = new String[] { @"……\ sample1.xlsx", @"……\ sample2.xlsx", @"……\ sample3.xlsx"};
            for (int i = 0; i < excelFiles.Length; i++)
            {
                tempbook.LoadFromFile(excelFiles[i]);
                foreach (Worksheet sheet in tempbook.Worksheets)
                {
                    newbook.Worksheets.AddCopy(sheet);
                }
            }
            newbook.SaveToFile("result.pdf",FileFormat.PDF);


3. To achieve your requirement, you will need Spire.XLS Pro Edition.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Tue Oct 15, 2019 10:26 am

Thank you so much for quick response.
About :
3. To achieve your requirement, you will need Spire.XLS Pro Edition. -> It mean I only need Spire.XLS and no need spire.PDF ?
Because when I try free software, I must using both of them :
using Spire.Pdf;
using Spire.Xls.Converter;

NguyenHuong
 
Posts: 2
Joined: Tue Oct 15, 2019 7:31 am

Wed Oct 16, 2019 3:24 am

Hi,

Thanks for your reply.
Yes, you only need Spire.XLS Pro Edition. The function of converting Excel file to Pdf file, merging Excel file then convert it to Pdf file are included in Spire.XLS Pro Edition. Please reference all the dlls(Spire.Common.dll, Spire.License.dll, Spire.Pdf.dll, Spire.XLS.dll)) from Spire.XLS.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Fri Oct 18, 2019 10:41 am

Hi,

Greetings from E-iceblue.
Has your issue been resolved? Could you please give us some feedback at your convenience?

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.XLS