You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, I'm using "get" method to get PDF data from specific page. I wonder that can we get all PDF data at once instead of getting data page by page like that?
My code:
public static int rowNumberOfPDFFile(String pdfLink, int pagePDFNumber) throws IOException {
PDFTableExtractor extractor = new PDFTableExtractor();
List
tables = extractor.setSource(pdfLink).extract();
// get date from page 1 to String html. Page number starts from 0 String html = tables.get(pagePDFNumber).toHtml();
html = html.substring(html.indexOf("border='1'>") + 11);
int rowNumber = org.apache.commons.lang3.StringUtils.countMatches(html, "/tr");
return rowNumber;
}
I would like to get all PDF data into "html" field. Could you please help?
Thanks,
Phan Nguyen
The text was updated successfully, but these errors were encountered:
I think you can do it by getting the html content of tables in all pages
then use html parser such as Jsoup to parse table content and put them all
together. Or you can also loop through all table models which are result of
PDFTableExtractor.extract().
Currently, I'm using "get" method to get PDF data from specific page. I
wonder that can we get all PDF data at once instead of getting data page by
page like that?
My code:
public static int rowNumberOfPDFFile(String pdfLink, int pagePDFNumber)
throws IOException {
PDFTableExtractor extractor = new PDFTableExtractor();
List
tables = extractor.setSource(pdfLink).extract();
// get date from page 1 to String html. Page number starts from 0 String html = tables.get(pagePDFNumber).toHtml();
html = html.substring(html.indexOf("border='1'>") + 11);
int rowNumber = org.apache.commons.lang3.StringUtils.countMatches(html, "/tr");
return rowNumber;
}
I would like to get all PDF data into "html" field. Could you please help?
Hi a. Tho,
Currently, I'm using "get" method to get PDF data from specific page. I wonder that can we get all PDF data at once instead of getting data page by page like that?
My code:
public static int rowNumberOfPDFFile(String pdfLink, int pagePDFNumber) throws IOException {
tables = extractor.setSource(pdfLink).extract();PDFTableExtractor extractor = new PDFTableExtractor();
List
// get date from page 1 to String html. Page number starts from 0
String html = tables.get(pagePDFNumber).toHtml();
I would like to get all PDF data into "html" field. Could you please help?
Thanks,
Phan Nguyen
The text was updated successfully, but these errors were encountered: