Micro Focus QTP (UFT) Forums
How to save PDF file using QTP. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to save PDF file using QTP. (/Thread-How-to-save-PDF-file-using-QTP)



How to save PDF file using QTP. - karpatylvov - 10-05-2010

Hi guys,

I need help how to save PDF file using QTP.

In my application user generate PDF (script is ready); when PDF is open I need just save PDF on any drive. I try to record and play back, but don’t work for me.


Regards,
Gene.


RE: How to save PDF file using QTP. - Pallavii - 10-05-2010

what was the problem you were facing when u tried to save the PDF file?
I think u need to use Descriptive programming.


RE: How to save PDF file using QTP. - karpatylvov - 10-05-2010

Thanks for reply.

The problem is that QTP were not able to see save button or file - save as option to save PDF.
I am beginner in QTP so for me Descriptive programming is WOW!
Could you please help me with that? I need any options (save button or file - save as) just to save PDF.

Regards,
Gene.


RE: How to save PDF file using QTP. - Pallavii - 10-06-2010

Try the following:

Code:
Window("<your pdf window name>").Click
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "%{F}"        ' Press ALT+F
WshShell.SendKeys "{a}"              ' Send the corresponding letter which is underlined, for 'save' under 'File' Menu. This opens a 'save a copy' dialog box
Window("<pdf window>").Dialog("Save a Copy").Click
Window("Adobe Reader").Dialog("Save a Copy").WinEdit("File name:").Set "<File Path>"
Window("Adobe Reader").Dialog("Save a Copy").WinButton("Save").Click
Set WshShell = Nothing

Let me know if u face any issues in object identification.


RE: How to save PDF file using QTP. - karpatylvov - 10-06-2010

Thank you very much for code.
You are correct, I have a problem with window name object identification.
Below you can see PDF URL:

lifetimewealthanalyzer.com/lwp_pa/write/LWP_PA_109399_Current.pdf

Number 109399 is unique and always change. What should I do?


RE: How to save PDF file using QTP. - Melody M - 10-09-2010

Hi,
Saket's article on PDF is excellent!!!! Its available on Ankur's Learn QTP Blog itself, please check this, it might help youSmile

https://www.learnqtp.com/learnquicktestpdf-api-manipulating-pdfs-in-qtp/

Melody