This quick example is about how to convert PDF to Excel in Java. In order to export PDF to Excel Java based application running in MS Windows, macOS or Linux operating systems can be used with no dependence on Adobe Acrobat or any other tool. The API provides simple and easy to understand code to perform the conversion.
Steps to Convert PDF to Excel in Java
- Download and configure Aspose.PDF for Java from the Maven repository
- Add the reference to Aspose.PDF namespace in your project
- Load the source PDF file using Document class instance
- Create an ExcelSaveOptions object to apply output XLSX settings
- Finally, by using Save method in Java convert PDF to Excel
In Java PDF to Excel export can be easily achieved by using above steps. After adding the library reference and namespace, the first thing will be to load the source PDF file. The ExcelSaveOptions class provides a bunch of setter methods that you can use to set different export options for desired XLSX file. One may also skip using ExcelSaveOptions class instance and export PDF to XLSX using default options. In the end, the loaded PDF file will be saved either on disk or inside Stream as XLSX by using SaveFormat.Excel enumerator inside Save method.
Code to Convert PDF to Excel using Java
The above example is using Java code to convert PDF to Excel file which can be viewed in Microsoft Excel or in Google Docs online. The ExcelSaveOptions class exposes a bunch of different export options that you may set for desired XSLX, including properties like Format, ConversionEngine, InsertBlankColumnAtFirst and MinimizeTheNumberOfWorksheets.
The above topic walked you through to process of how to convert PDF to Excel using Java. If you are keen to export PDF to Image, refer to the article on how to Convert PDF to Image in Java.