Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created May 22, 2021 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/c54011c23506f561da98126b8307f13c to your computer and use it in GitHub Desktop.
Save GroupDocsGists/c54011c23506f561da98126b8307f13c to your computer and use it in GitHub Desktop.
Convert PDF or Word file to Excel Spreadsheet in Java
// Convert PDF document to Excel Spreadsheet in Java
Converter converter = new Converter("document.pdf");
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
converter.convert("pdfToExcel.xlsx", options);
// Convert second page of PDF file to Excel in Java with some options
Converter converter = new Converter("document.pdf");
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
options.setPageNumber(2);
options.setPagesCount(1);
options.setFormat(SpreadsheetFileType.Xlsx);
options.setZoom(120);
converter.convert("pdfToExcelAdv.xlsx", options);
// Convert Word document to Excel Spreadsheet in Java
Converter converter = new Converter("document.docx");
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
converter.convert("wordToExcel.xlsx", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment