i want to read a table from pdf
Hi there,
Thanks for your inquiry. I am afraid currently Aspose.Pdf does not support feature to manipulate existing tables in PDF file. We have already logged a feature request to read/manipulate existing tables in PDF files. We have linked your post to the issue and will notify you as soon as it is implemented.
However, as a workaround you can convert PDF file to excel using the following code and use Aspose.Cells to read data from the excel worksheet.
Document doc = new Document(myDir+"ZKB.pdf");
ExcelSaveOptions options = new ExcelSaveOptions();
doc.save(myDir+"output.xls", options);
Please feel free to contact us for any further assistance.
Best Regards,
Hi Ahmad,
I tried the code which you have given with maven but i was getting error i.e.
Failure to find com.aspose:aspose-pdf:jar:14.5.0 in http://maven.aspose.com/artifactory/simple/ext-release-local/…
is there any update regarding pdf table data read?
Hi there,
Hi Rajesh,
Hi Rajesh,
Hi Rajesh,
Thanks for your patience.
We are pleased to share that the issue reported earlier is resolved and its fix will be included in upcoming release of Aspose.Pdf for Java 10.6.0. In order to generate correct output, please try using following code snippet.
Java
Document pdfDocument = new Document(myDir + "table.pdf");
// Create TableAbsorber object to find tables
TableAbsorber absorber = new TableAbsorber();
// Visit first page with absorber
absorber.visit(pdfDocument.getPages().get_Item(1));
// Get access to first table on page, their first cell and text fragments in it
TextFragment fragment = absorber.getTableList().get_Item(0)
.getRowList().get_Item(0)
.getCellList().get_Item(0)
.getTextFragments().get_Item(1);
// Change text of the first text fragment in the cell
fragment.setText("hi world");
pdfDocument.save(myDir + "out_table_1060.pdf");
The issues you have found earlier (filed as PDFNEWJAVA-33729) have been fixed in Aspose.Pdf for Java 10.6.0 .
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(1)