I need to use TestComplete to save the PDF file into text format. The scenario is as follow :
1) It is a web based application. In the application there is button,when I click on the button it will show dialog box below.
2) I am able to open the PDF file by clicking on the PDF button.
3) PDF file open in Adobe Reader, now I need to Save the PDF as text format by going to File - SaveAsOther and select the Text option
4) I tried the recording this part, but it is not working as well not reliable. Also tried using shell script with the send keys but it is not Saving it.
I am not sure what is the issue.For the sendkeys my assumption is that it is not able to work on the PDF file,but then I tried activating and also maximizing it but it does not work. Please let me know if you have better or reliable solution
Below is my code :-
'Click on the open button to open the PDF File
If Aliases.browser.BrowserWindow.FrameNotificationBar.Exists Then
Call Aliases.browser.BrowserWindow.FrameNotificationBar.Click 'this statment to have the focus on the notificaton bar
If Sys.WaitProcess("AcroRd32 *32",1000).Exists Then
'Save the PDF file to Text
Set oShell = CreateObject("WScript.Shell")
1st Approach: I recorded the saving of the PDF file using Keyword Test but when I ran the test again it was failing the reason been that the Acorbat Reader object was changing the index no. I tried using regular expression but somehow it was not working.
2nd Approach :- I used the shell script and it is now able to save the file but the thing is if the PDF file open slightly late then the shell command are run on the browser. Most of the time it works when the PDF open in a timely manner. I have a put the delay of 1 second and it works but it is not good approach as the PDF may take more time that I expected. We require some dynamic wait option but somehow the PDF window is change dynamically changing it's index and it is not working for me. If you have better solution then let me know to have consistent results.