Forum Discussion

mikakoistinen's avatar
mikakoistinen
Contributor
8 years ago

Reading PDF /PDDocument.load_3 or load not found

Hi,

I have tried to setup PDF reading accoring to instructions found here

https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete/#Extr_Data_pdf

 

I have java virtualmachine C:\Program Files (x86)\Java\jre1.8.0_131\bin\client\jvm.dll

and I have added pdf-box 1.8.13.jar and classes to project

https://www.dropbox.com/s/16ojffsuzzr53rc/javasettings.PNG?dl=0

 

In script I get error "Unknown name load_3". same for load and load_2. Code completion works only until 

JavaClasses.org_apache_pdfbox_pdmodel.PDDocument after PDDocument nothing is shown.

 

But for example code completion in JavaClasses.org_apache_pdfbox_util.PDFTextStripper  shows three instances of NewInstance?

What is wrong here? My code is quite simple

 

function LoadPdf( FileName );
var 
  docObj;
begin
  docObj := JavaClasses.org_apache_pdfbox_pdmodel.PDDocument.load_3( FileName );
  result :=  docObj;
end;

 

I have TestComplete 12.

 

thanks,

mika

 

 

  • mikakoistinen's avatar
    mikakoistinen
    8 years ago

    Hah... stupid me

    I had added pdfbox-1.8.13.jar , not pdfbox-app-1.8.13.jar which is correct one.

    This java world is so confusing...  :manfrustrated:

     

  • I think I solved this. I added pdfbox-app-2.0.6.jar to class paths and after that codecompletion started to work.

     

    • mikakoistinen's avatar
      mikakoistinen
      Contributor

      Hah... stupid me

      I had added pdfbox-1.8.13.jar , not pdfbox-app-1.8.13.jar which is correct one.

      This java world is so confusing...  :manfrustrated: