Jump to content

Print webpage as PDF


Mohanraj
 Share

Recommended Posts

#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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...