Convert XLSX to PDF/A via Java
XLSX to PDF/A Java conversion to convert single or multiple pages to PDF/A using On-premise Java library.
How to Convert XLSX to PDF/A Using Java
In order to render XLSX to PDF/A, we’ll use
API which is a feature-rich, powerful and easy to use conversion API for Java platform. You can download its latest version directly from
and install it within your Maven-based project by adding the following configurations to the pom.xml.
Repository
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
Dependency
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells</artifactId>
<version>version of aspose-cells API</version>
<classifier>jdk17</classifier>
</dependency>
Steps to Convert XLSX to PDF/A via Java
Java developers can easily convert XLSX file to PDF/A in just a few lines of code.
- Load XLSX file with an instance of Workbook class
- Create PdfSaveOptions class object
- Set the compliance type PdfCompliance.PdfA1b
- Call Workbook.save method
- Pass output path with PDF extension & PdfSaveOptions object as parameters
- Check specified path for resultant PDF/A file
System Requirements
Before running the Java conversion source code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
- Get latest version of Aspose.Cells for Java directly from Maven.
XLSX to PDF/A Java Conversion Source Code
// Open an Excel file | |
Workbook workbook = new Workbook(dataDir + "Book1.xlsx"); | |
// Define PdfSaveOptions | |
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(); | |
// Set the compliance type NONE, PDF_A_1_B, PDF_A_1_A | |
// The value of the property is PdfCompliance integer constant. | |
// https://apireference.aspose.com/cells/java/com.aspose.cells/PdfCompliance | |
pdfSaveOptions.setCompliance(PdfCompliance.PDF_A_1_B); | |
// Save the file | |
workbook.save(dataDir + "output.pdf", pdfSaveOptions); |
XLSX to PDF Conversion Live Demos
Other Supported Conversions
You can also convert XLSX into many other file formats including few listed below.