Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sat Nov 04, 2023 3:58 am

I am currently using Spire.pdf to convert pdf to Excel. When I try to convert pdf having 10 pages, it's converting each page data into individual excel sheets. i.e Generated excel having 10 sheets. Is there possibility to convert all 10 pages data into a single excel sheet?
I am planning to purchase license if this option available.

Thanks
Nivas

nivas.svr
 
Posts: 1
Joined: Sat Nov 04, 2023 3:50 am

Mon Nov 06, 2023 8:02 am

Hi,

Thank you for your inquiry.
Please set the first parameter in the red box of the following figure to false, which means that conversion to multiple worksheets is not allowed.
98A72880-E929-48cb-B154-6CC28DEB9B1E.png

I put the complete code below for your referenece:
Code: Select all
            // Create a new PdfDocument object
            PdfDocument pdf = new PdfDocument();

            // Specify the path of the PDF file to be converted
            string PDFFile = @"E:\test\1.pdf";

            // Load the PDF file into the PdfDocument object
            pdf.LoadFromFile(PDFFile);

            // Create a new XlsxLineLayoutOptions object with specified options
            XlsxLineLayoutOptions xlsxLineLayoutOptions = new XlsxLineLayoutOptions(false, true, true);

            // Set the conversion options for the PdfDocument object
            pdf.ConvertOptions.SetPdfToXlsxOptions(xlsxLineLayoutOptions);

            // Specify the path and format of the resulting Excel file
            string ExcelFile = @"E:\test\PdfToXlsxOptions_results1.xlsx";

            // Save the converted PDF file as an Excel file
            pdf.SaveToFile(ExcelFile, Spire.Pdf.FileFormat.XLSX);

If you have any issue just feel free to contact us.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Tue Nov 28, 2023 7:32 am

Hi,

Did you test the code on your side? Did it solve your problem?
Please feel free to us, if you have any problem.

Best Regards,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Return to Spire.PDF