Convert PDF to Excel and Manipulate Content in PDF in Android using Java

After Aspose.PDF for Android via Java 17.7 release, we are honored to announce Aspose.PDF for Android via Java 17.12. Aspose.PDF for Android via Java 17.12 has been released for Android platforms and ready to be used in Android Applications. For a detailed overview of the changes and improvements in this new release of the API, please visit the release notes page in the API documentation. However, there are the following major features, we would like to mention, which have been added in Aspose.PDF for Android via Java 17.12.

Convert PDF to Excel in Android

Since Inter-File Formats Conversion has been an interesting feature of the APIs offered by Aspose – we have added support to convert PDF file into Excel format, in Aspose.PDF for Android via Java 17.12. This new release of the API offers you following two different methods which can be used according to your requirements regarding conversion:

The following code sample shows how to convert PDF to Excel in Android using Java:

More details about this feature have also been given in Convert PDF file to Excel Format article of API documentation.

Manipulate Tables in Existing PDF

Aspose.PDF for Android via Java 17.12, now offers the feature to search and parse simple tables that already exist in PDF document. This new feature in the API has come with the addition of new class com.aspose.pdf.TableAbsorber which provides the capabilities to search and manipulate the tables in PDF documents. The usage of TableAbsorber is very much similar to the existing TextFragmentAbsorber Class. The following code snippet shows the steps to update contents in particular table cell:

String inputPath = "/mnt/sdcard/Table.pdf";
String outputPath = "/mnt/sdcard/Table_out.pdf";
// Load document
Document pdfDocument = new Document(inputPath);
// Create TableAbsorber object to find tables
TableAbsorber absorber = new TableAbsorber();
// Visit first page with absorber
// Get access to first table on page, their first cell and 
// text fragments in it
Table table = (Table) absorber.getTableList().get_Item(0);                      
Cell cell = table.getRows().get_Item(0).getCells().get_Item(0);                  
TextFragment fragment = 
(TextFragment) cell.getParagraphs().get_Item(1);
// Change text of the first text fragment in the cell
fragment.setText ("Hello World!");
// Save updated document;

Apply Gradient Color to Graph

We have implemented support for gradient color in Aspose.PDF for Android via Java 17.12, in order to apply gradient color to the Graph. The feature can be used with new property PatternColorSpace and class GradientAxialShading which has been added into com.aspose.pdf.drawing Package. The following code snippet demonstrates the usage of new added properties and classes, in order to apply gradient color:

String outputPath = "/mnt/sdcard/GradientColor_out.xlsx";
// Initialize Document object
Document doc = new Document();
// Add a new page
Page page = doc.getPages().add();
Graph graph = new Graph(300, 300);
// Add a Graph
com.aspose.pdf.drawing.Rectangle rect = 
new com.aspose.pdf.drawing.Rectangle(0, 0, 300, 300);
rect.getGraphInfo().setFillColor(new com.aspose.pdf.Color());
// Use GradientAxialShadding for Gradient
GradientAxialShading gradientAxialShading = 
new GradientAxialShading(Color.getRed(), Color.getBlue());
gradientAxialShading.setStart(new Point(0, 0));
gradientAxialShading.setEnd(new Point(300, 300));
// Save the document;

Miscellaneous Fixes and Resources

Along with the new features, which have been shared above, we have also made some bug fixes in this release of the API – which can be seen in the release notes section of the API documentation. Please visit the following links for information regarding the latest release of Aspose.PDF for Android via Java and Release Notes section. In case you have any questions about Aspose.PDF for Android via Java, you can post your inquiry in Aspose.PDF forums. We will be more than happy to assist you there.