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.

Mon Jun 13, 2022 9:04 am

how to convert xls to PDF full page A4

Code: Select all
                  name = "filename.xls;
                  File.WriteAllBytes(name, System.Convert.FromBase64String(//**Base64 file));

                    Workbook document = new Workbook();
                    document.LoadFromFile(name);
                    for (int j = 0; j < document.Worksheets.Count; j++)
                    {
                        document.Worksheets[j].PageSetup.IsFitToPage = true;
                    }
                    document.SaveToFile("filePDF.pdf", Spire.Xls.FileFormat.PDF);


file excle
Image

result
page A4
Image

jame_piyawat2
 
Posts: 10
Joined: Fri May 07, 2021 4:36 am

Mon Jun 13, 2022 10:12 am

Hi,

Thank you for your inquiry.
I did an initial test but didn't reproduce your problem. When converting Excel to PDF, the page size is A4 by default. In order to help us effectively solve your problem, please provide your Excel document and excepted output PDF. You can attach your file here or send it to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Wed Oct 19, 2022 3:36 am

Hi,

Greetings from E-iceblue!
Has your problem been effectively solved now? Can you give us some feedback at your convenience?

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Return to Spire.XLS