tmahender12, maximojo :
OK, I've spent a bit of time for the DelphiScript project from the https://support.smartbear.com/support/media/images/techpapers/testcomplete/samples/Sample-TestComplete-Project.zip suite used as a sample in the https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete/ article.
These were the changes I made to make the first 'Getting Text' test item not to fail for the pdfbox-app-2.0.1.jar :
For the PDFExamples_DelphiScript project:
-- Switch to the project properties and select the JavaBridge node;
-- Remove the reference to the pdfbox-app-1.8.12.jar file and add instead a reference to the pdfbox-app-2.0.1.jar one in the Class Paths box;
-- Add org.apache.pdfbox.text.PDFTextStripper class to the Java Classes box
For the code:
-- code line like
// docObj := JavaClasses.org_apache_pdfbox_pdmodel.PDDocument.load_3(fileName);
must be replaced with the following code snippet
aFile := JavaClasses.java_io.File.newInstance(fileName);
docObj := JavaClasses.org_apache_pdfbox_pdmodel.PDDocument.load_2(aFile);
-- code line like
// textStripperObj := JavaClasses.org_apache_pdfbox_util.PDFTextStripper.newInstance();
must be replaced with the following line
textStripperObj := JavaClasses.org_apache_pdfbox_text.PDFTextStripper.newInstance();
-- code line like
// text := textStripperObj.getText_2(docObj);
must be replaced with the following line
text := textStripperObj.getText(docObj);
Hope, this will help...
P.S. Version 2.0 of PDFBox processed pdf of size >800KB without any problem, while previous version 1.8 failed because of the 'Could not push back xxx bytes in order to reparse stream' error from Java.
P.P.S.: HKosova, TanyaYatskovska : maybe this will be of some use when you update the sample and the article...