Unable to print with ONPRINT

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
REXYIM
Posts: 3
Joined: Wed Jan 22, 2020 6:26 am

Unable to print with ONPRINT

Post by REXYIM » Thu Jan 23, 2020 10:01 am

Hi All,

i use below to try to print the screen shot but in vain

URL GOTO=www.yahoo.com
WAIT SECONDS=4
ONPRINT P=* BUTTON=PRINT
url goto=javascript:window.print()

but the result is that only the print dialog shown up and no print out could be made at all, any ideas what i did incorrectly :oops: , please help!!

thank you very much.
User avatar
thecoder2012
Posts: 405
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Unable to print with ONPRINT

Post by thecoder2012 » Thu Jan 23, 2020 5:10 pm

REXYIM wrote:
Thu Jan 23, 2020 10:01 am
i use below to try to print the screen shot but in vain
Which iMacros version? Browser? System?
REXYIM wrote:
Thu Jan 23, 2020 10:01 am
but the result is that only the print dialog shown up and no print out could be made at all, any ideas what i did incorrectly :oops: , please help!!
Firefox => about:config => select New > Boolean => Enter the preference name as print.always_print_silent and click OK.
Chrome => Edit the shortcut you use to start Chrome and add "--kiosk-printing" (or --kiosk-noprint?) then restart Chrome.

See silent-printing-in-a-web-application, javascript-print-without-print-dialog-box, how-to-print-without-print-dialog-box-in-chrome, how-can-i-pop-up-a-print-dialog-box-using-javascript, Print-HTML-from-Javascript-to-client-printer-without-print-dialog-silently or chrome.printerProvider
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
chivracq
Posts: 9380
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Unable to print with ONPRINT

Post by chivracq » Thu Jan 23, 2020 9:36 pm

REXYIM wrote:
Thu Jan 23, 2020 10:01 am
Hi All,

i use below to try to print the screen shot but in vain

Code: Select all

URL GOTO=www.yahoo.com
WAIT SECONDS=4
ONPRINT P=* BUTTON=PRINT
url goto=javascript:window.print()
but the result is that only the print dialog shown up and no print out could be made at all, any ideas what i did incorrectly :oops: , please help!!

thank you very much.

>>>
thecoder2012 wrote:
Thu Jan 23, 2020 5:10 pm
REXYIM wrote:
Thu Jan 23, 2020 10:01 am
i use below to try to print the screen shot but in vain
Which iMacros version? Browser? System?

Yep indeed...! :roll:
Maybe an Idea @OP when you join a Tech Forum to read the Forum Rules, ah-ah...!? :idea:
=> CIM...! :mrgreen: (Read my Sig also...)


>>>
thecoder2012 wrote:
Thu Jan 23, 2020 5:10 pm
REXYIM wrote:
Thu Jan 23, 2020 10:01 am
but the result is that only the print dialog shown up and no print out could be made at all, any ideas what i did incorrectly :oops: , please help!!
Firefox => about:config => select New > Boolean => Enter the preference name as print.always_print_silent and click OK.
Chrome => Edit the shortcut you use to start Chrome and add "--kiosk-printing" (or --kiosk-noprint?) then restart Chrome.

See:
- silent-printing-in-a-web-application,
- javascript-print-without-print-dialog-box,
- how-to-print-without-print-dialog-box-in-chrome,
- how-can-i-pop-up-a-print-dialog-box-using-javascript,
- Print-HTML-from-Javascript-to-client-printer-without-print-dialog-silently or
- chrome.printerProvider

Hum, interesting Links/Research... :D 8)

@OP uses 'ONPRINT' in their Script, which I think is only supported in iMB + iMacros for IE, and I guess that Command probably yields some Parsing Error "Unknown Command" in FF and CR..., so I guess the "pure" FF/CR (interesting!) Solutions probably won't work for this User in this Case... :|
Last edited by chivracq on Fri Jan 24, 2020 7:10 am, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
REXYIM
Posts: 3
Joined: Wed Jan 22, 2020 6:26 am

Re: Unable to print with ONPRINT

Post by REXYIM » Fri Jan 24, 2020 1:07 am

Hi All,

sorry for the insufficient information for my problem, please refer to below my info.

1. What version of iMacros are you using?
iMacros Sidebar for Internet Explorer (x64) Version 12.0.501.6698

2. What operating system are you using? (please also specify language)
Window 10 pro

3. Which browser(s) are you using? (include version numbers)
IE11 version 11.805.17763.0

Onprint should work for IE i think, current situation is "Print" could call out he print dialog, however, it stuck, no instruction could be placed to the dialog from Onprint, it keep showing the dialog on screen.

hope it helps, i need to print over 10000 print screen for my task :cry:
REXYIM
Posts: 3
Joined: Wed Jan 22, 2020 6:26 am

Re: Unable to print with ONPRINT

Post by REXYIM » Fri Jan 24, 2020 1:14 am

@OP uses 'ONPRINT' in their Script, which I think is only supported in iMB + iMacros for IE, and I guess that Command probably yields some Parsing Error "Unknown Command" in FF and CR..., so I guess the "pure" FF/CR (interesting!) Solutions probably won't work for this User in this Case...

BTW, there are no error message prompted at all, the system just keep the print dialog on screen and the script paused at the row "PRINT" forever........... :lol:
User avatar
thecoder2012
Posts: 405
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Unable to print with ONPRINT

Post by thecoder2012 » Sun Jan 26, 2020 3:08 pm

chivracq wrote:
Thu Jan 23, 2020 9:36 pm
Hum, interesting Links/Research... :D 8)
But you have not really checked my links? And newest iMacros changelog (v12.6) is unknown for you? :?:
thecoder2012 wrote:
Thu Jan 23, 2020 5:10 pm
@OP uses 'ONPRINT' in their Script, which I think is only supported in iMB + iMacros for IE, and I guess that Command probably yields some Parsing Error "Unknown Command" in FF and CR..., so I guess the "pure" FF/CR (interesting!) Solutions probably won't work for this User in this Case... :|
My text was only for FF/CR but my links not. Because IE workaround is not good for the future.
REXYIM wrote:
Fri Jan 24, 2020 1:07 am
1. What version of iMacros are you using?
iMacros Sidebar for Internet Explorer (x64) Version 12.0.501.6698
Why not 12.6?

Reasons says the changelog (v12.6+):
- New: Handle print output dialog from ONPRINT to a PDF/XPS printer (Windows 8/Windows Server 2012 and above)
- Fixed: Print dialog not handled from iMacros for IE
See https://wiki.imacros.net/ONPRINT (e.g. Save the .xps output file, introduced in v. 12.6)
REXYIM wrote:
Fri Jan 24, 2020 1:07 am
3. Which browser(s) are you using? (include version numbers)
IE11 version 11.805.17763.0
This version has no future. See https://techcommunity.microsoft.com/t5/ ... a-p/331732 and https://support.microsoft.com/help/1745 ... t-explorer
REXYIM wrote:
Fri Jan 24, 2020 1:07 am
Onprint should work for IE i think, current situation is "Print" could call out he print dialog, however, it stuck, no instruction could be placed to the dialog from Onprint, it keep showing the dialog on screen.
REXYIM wrote:
Fri Jan 24, 2020 1:07 am
hope it helps, i need to print over 10000 print screen for my task :cry:
Only with IE and iMacros!? :?:
This is crazy. Better portale editions in this case and you have no future problems.
10000 print screen in a single case? Second solution is like Remote Printing for Web Apps (Printnode, 50 prints free per month in the LITE version)
REXYIM wrote:
Fri Jan 24, 2020 1:14 am
BTW, there are no error message prompted at all, the system just keep the print dialog on screen and the script paused at the row "PRINT" forever........... :lol:
See above. Or try a workaround with IE. I have alredy posted links with FF/CR/IE things.
For only IE things (untested) see https://stackoverflow.com/a/21924/6103614 or old method https://stackoverflow.com/a/15228701/6103614
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
Post Reply