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