Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Ciao, thanks for sharing this.
But is not clear how i can specify which is the pdf file that must be ridden inside the script.
Can you clarify?
Thanks
Loaded the Apache pdfbox jar pdfbox-app-2.0.25.jar into a tlibraryLoad component. Then used a tJava component to read a PDF file
tJava Code:
/*
File file = new File("/opt/sample.pdf");
PDDocument document = PDDocument.load(file);
PDFTextStripper pdfStripper = new PDFTextStripper();
String text = pdfStripper.getText(document);
System.out.println("Text:" + text);
document.close();
*/
PDDocument document = PDDocument.load(new File("/opt/pdf.pdf"));
if (!document.isEncrypted()) {
PDFTextStripper stripper = new PDFTextStripper();
String text = stripper.getText(document);
System.out.println("Text:" + text);
}
document.close();
tJava Advanced Settings:
import java.io.File;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.apache.pdfbox.text.PDFTextStripperByArea;