IE COM print as PDF

Get help with using AutoHotkey and its commands and hotkeys
euras
Posts: 389
Joined: 05 Nov 2015, 12:56

IE COM print as PDF

20 Aug 2019, 12:49

Hi, I'm trying to figure it out how to print the webpage as a PDF using standard Microsoft print to PDF printer and setting destination of file.
I want to avoid all those hardcodes as Send ^p and so on.

So far I know that there are 3 different ways to open Print page, but I dont know how to set up it forward (it would be best if I dont need to play with Print page and instead of that I just call DLL or IE command to print("pdf", "location") or something like that.)

Code: Select all

PostMessage, 0x111, 260,, Shell DocObject View1, A ;WM_COMMAND := 0x111 ;Print...

Code: Select all

for wb in ComObjCreate("Shell.Application").Windows
    if InStr(wb.FullName, "iexplore.exe")
        wb.document.parentWindow.print

Code: Select all

pwb.Navigate("javascript:window.print()")

Return to “Ask For Help”

Who is online

Users browsing this forum: ahkfan, Google [Bot] and 273 guests