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.

Tue Dec 10, 2024 11:10 pm

I would like to know how to use the XlsxLineLayoutOptions and setPdfToXlsxOptions command (in Java).

Is there any manual or reference material available for this?

(Details about the options for this command, etc.)

Currently, I am using it as shown below:

pdf.getConvertOptions().setPdfToXlsxOptions(new XlsxLineLayoutOptions(false, true, false, true, true));

Thank you always for your quick responses.

hdj_11255
 
Posts: 7
Joined: Thu Aug 22, 2024 12:50 am

Wed Dec 11, 2024 7:33 am

Hello,

Thanks for your inquiry.

Here's a detailed explanation of each parameter based on XlsxLineLayoutOptions(false, true, false, true, true):
Code: Select all
new XlsxLineLayoutOptions(
    false,  // convertToMultipleSheet
    true,   // rotatedText
    false,  // splitCell
    true,   // warpText
    true    // overlapText
)

convertToMultipleSheet: This option determines whether the PDF document should be converted into multiple sheets in the resulting Excel file. When set to false, it means that the content will not be split across multiple sheets. The default is true.

rotatedText : This option specifies whether rotated text in the PDF should be preserved in the Excel output. If this is set to true, any text that is rotated in the original PDF will also appear rotated in the Excel file. The default is true.

splitCell : This option controls the handling of cells containing multiple lines of text within a table in the PDF document. When set to false, it means that cells with multiple lines of text will not be split into separate rows in the Excel file. The default is true.

warpText: This option indicates whether text wrapping should be applied to objects in Microsoft Excel. If set to true, text that does not fit within the width of a cell will wrap onto the next line within the same cell, improving the readability of the content in the Excel file.

overlapText : This option allows for the display of overlapping text in the Excel file. If set to true, text elements that overlap in the PDF will be rendered similarly in Excel.

Code: Select all
import com.spire.pdf.*;
import com.spire.pdf.conversion.XlsxLineLayoutOptions;

public class PDFtoExcel{
    public static void main(String[] args) {

        //Create a PdfDocument object
        PdfDocument pdf = new PdfDocument();

        //Load a sample PDF file
        pdf.loadFromFile("C:\\Users\\Administrator\\Desktop\\1.pdf");

        pdf.getConvertOptions().setPdfToXlsxOptions(new XlsxLineLayoutOptions(false, true, false, true, true));

        //Save to Excel
        pdf.saveToFile("1.xlsx", FileFormat.XLSX);
    }
}



If you have further questions, please let us know.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3001
Joined: Wed Jun 27, 2012 8:50 am

Thu Dec 12, 2024 5:03 am

Are there any other options besides the five options?

thank you

hdj_11255
 
Posts: 7
Joined: Thu Aug 22, 2024 12:50 am

Thu Dec 12, 2024 6:58 am

Hello,

Thanks for your further inquiry.

There are only 5 options available at the moment.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3001
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF