Hi Marin,
I have reproduced the issue with your sample PDF document. However, it is not really caused by TestComplete's functionality. Actually, the same problem occurs if you try to extract text from your PDF document with PDFTextStripper without using TestComplete. I have attached a simple Java console application that extracts text from the TEST.pdf file by using the PDFBox library in the way similar to your foo scripting routine and outputs the results to the console window. You can run it in the following way:
1) Extract files (Main.java and run.bat) from the attached PDFTextStripperSample.zip archive to the folder where your pdfbox-app-1.6.0.jar resides. Also, place your TEST.pdf file to the same folder.
2) In the jdkdir parameter within the run.bat file, specify the fully-qualified path to the bin subfolder of the folder where the Java Development Kit is installed on your computer. Save the changes.
3) Execute the run.bat batch file to run the application.
If you run the sample application, you will see that the text extracted from your PDF document by PDFTextStripper and printed to the console window contains only special characters (like when you use PDFTextStripper in TestComplete scripts). These characters correspond to the symbol codes obtained by PDFTextStripper from the specified PDF document. So, TestComplete does not affect the results returned by PDFTextStripper. TestComplete just receives the text from PDFTextStripper as is.
It looks like the problem is actually caused by some specifics either in the PDFBox library (I'm not sure about it since it is a third-party library), or in your PDF document (the latter is more probable). Actually, I did not face such a problem when I used PDFBox with all my sample PDF documents. I can reproduce the issue only with your PDF document. Perhaps, it is caused by the font encoding used in your PDF document, but unfortunately, I do not know that exactly.