Forum Discussion

ykrrishna's avatar
ykrrishna
Occasional Contributor
8 years ago

Does JavaBridge in testComplete work on a Python Project ?

I am working on a project to test the contents of a pdf file.   I was suggested with this URL in my previous question "https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-t...
  • HKosova's avatar
    8 years ago

    That article was created for PDFBox version 1.8.6. The current version is 2.0.4 and it appears to have introduced some breaking changes. For example, PDDocument.load no longer accepts file names and requires a java.io.File object instead. So you need to use something like:

    file = JavaClasses.java_io.File.newInstance("C:\\MyFile.pdf")
    docObj = JavaClasses.org_apache_pdfbox_pdmodel.PDDocument.load_2(file)

    AlexKaras posted some more tips in another thread, check the first link in his answer.

     

    Also, the PDFBox API docs are the source of truth for parameter types, supported methods, etc.