Estou pegando 2 arquivos que estão na minha pasta e estou precisando retornar o conteúdo desses 2 arquivos, não sei o motivo mais estou recebendo como retorno só um conteúdo, podem me ajudar?
public String pdfLeitor() {
String[] string = null;
String arquivos = null;
File file = new File("C:\\Users\\Ruben\\Desktop\\teste\\");
File afile[] = file.listFiles();
for (int i = 0; i < afile.length; i++) {
string = new String[afile.length];
string[i] = afile[i].toString();
arquivos = string[i];
}
String texto = null;
for (int i = 0; i < afile.length; i++) {
try {
PdfReader reader = new PdfReader(arquivos);
texto = PdfTextExtractor.getTextFromPage(reader, 1);
} catch (IOException e) {
e.getStackTrace();
}
}
return texto;
}