Mohanraj Posted December 28, 2018 Share Posted December 28, 2018 Hello Everyone, Please guide me how to print the webpage as PDF and saving it in the sepecific Path. I am new to AutoIT. Please do needful. Thank you, Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted December 28, 2018 Share Posted December 28, 2018 Hi @Mohanraj, and welcome to the AutoIt forums We can help you with your script, so, what have you tried so far? Which browser are you using? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Mohanraj Posted December 28, 2018 Author Share Posted December 28, 2018 #include <IE.au3> #include <MsgBoxConstants.au3> #include <WinAPISys.au3> #include <WinAPIDlg.au3> #include <GUIConstantsEx.au3> #include <SendMessage.au3> #include <StaticConstants.au3> #include <WinAPIGdi.au3> #include <WinAPIGdiDC.au3> #include <WinAPIHObj.au3> #include <WindowsConstants.au3> #include 'printMGv2.au3' Local $oIE = _IECreate("www.google.com") local $printer = _WinAPI_GetDefaultPrinter ( ) MsgBox("", "DefaultPrinter", $printer) ;printing the webpage _IEAction($oIE, "printdefault") Sleep(2000) $oIE = _WinAPI_FindWindow("CLASS:#32770]", "Save Print Output As") Sleep(2000) local $ret1 = _WinAPI_ChildWindowFromPointEx($oIE,0) ControlCommand($oIE, "Save Print Output As", "[ID#:32770]", "") Sleep(2000) ControlSend($ret1, "", "[CLASS:Edit; INSTANCE:1]", "D:\SDAT.pdf") sleep(1000) WinWaitActive("[CLASS:Button; INSTANCE:2]") Sleep(1000) Send("{TAB}{ENTER}") _IEQuit the above is my Code. It will taking me to Print Dialog Box however i am unable to pass the path and click the Save button. I am using IE Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now