Hi Marin,
variable "text" will still be empty in Log window when trying to otput it |
Actually, the value returned by the
getText_2 method is a String object with a number of properties, fields and methods. TestComplete also adds the
OleValue special property to this object. I recommend that you call this property to obtain the string stored in your
text object. For example:
function foo()
{
var doc = JavaClasses.org_apache_pdfbox_pdmodel.PDDocument.load_3("C:\\temp\\TEST.pdf");
var pdfStripper = JavaClasses.org_apache_pdfbox_util.PDFTextStripper.newInstance();
var text = pdfStripper.getText_2(doc);
Log.Message(text.length());
Log.Message(text.OleValue);
}
Does this help?
BTW, you can set a breakpoint on one of the last two lines in your
foo script routine and try to debug it. When the script execution is stopped at the breakpoint, you can easily inspect your
text object via the
Evaluate and
Inspect dialogs and explore the set of available object properties, fields and methods.