printing at client side without print dialog box

Reply

Join Date: Apr 2009
Posts: 13
Reputation: Poojasrivastava is an unknown quantity at this point 
Solved Threads: 0
Poojasrivastava Poojasrivastava is offline Offline
Newbie Poster

printing at client side without print dialog box

 
0
  #1
Jun 29th, 2009
hi..actually i am developing a web application wherein i need to print barcodes at client side.
i have the PCL file that would print the barcode but the problem lies in printing at the client side and that too without opening the print dialog box.
can somebody help me with this issue??
what i exactly want is that the user clicks the button and barcode is printed at the default printer (with no dialog box)..

somebody help me ..
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,444
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 626
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: printing at client side without print dialog box

 
0
  #2
Jun 29th, 2009
The printing behavior client side is handled by the browser and as far as I know you cannot change this behavior without writing a browser plugin.

According to a post I read it is possible for some browsers but I still do not recommend it:
http://www.webdeveloper.com/forum/sh...ad.php?t=85301
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,721
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 501
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: printing at client side without print dialog box

 
0
  #3
Jun 29th, 2009
Last edited by adatapost; Jun 29th, 2009 at 8:38 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 452
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 82
Ramesh S Ramesh S is offline Offline
Posting Pro in Training

Re: printing at client side without print dialog box

 
0
  #4
Jun 29th, 2009
Try the solution given by Andy0000 in the following link: http://www.webdeveloper.com/forum/ar.../t-174029.html

But it may work in IE only.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,721
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 501
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: printing at client side without print dialog box

 
0
  #5
Jun 29th, 2009
Use an ActiveX or Plugin ScriptX and Neptune from Meadroid to give you more control for Windows versions of Internet Explorer, Netscape, and Opera.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 1
Reputation: adamself is an unknown quantity at this point 
Solved Threads: 0
adamself adamself is offline Offline
Newbie Poster

Re: printing at client side without print dialog box

 
0
  #6
Jul 16th, 2009
OK this worked for me, ASP and IE8. This will print to your default printer as soon as the page loads.

** NO PRINTER DIALOG POP-UP!!!!!!! **

  1. <body onload="window.print();">
  2.  
  3. <OBJECT Classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0></OBJECT>
  4.  
  5. <SCRIPT LANGUAGE="JavaScript">
  6.  
  7. DA = (document.all) ? 1 : 0
  8.  
  9. </SCRIPT>
  10.  
  11. <SCRIPT LANGUAGE="VBScript">
  12.  
  13. sub print()
  14.  
  15. OLECMDID_PRINT = 6
  16.  
  17. OLECMDEXECOPT_DONTPROMPTUSER = 2
  18.  
  19. OLECMDEXECOPT_PROMPTUSER = 1
  20.  
  21. 'on error resume next
  22.  
  23.  
  24.  
  25. 'IE4 object has different command structure
  26.  
  27. if DA then
  28.  
  29. call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
  30.  
  31.  
  32.  
  33. else
  34.  
  35. call WB.IOleCommandTarget.Exec(OLECMDID_PRINT ,OLECMDEXECOPT_DONTPROMPTUSER,"","")
  36.  
  37.  
  38.  
  39. end if
  40.  
  41.  
  42.  
  43. end sub
  44.  
  45.  
  46.  
  47. 'This will be interpreted during loading.
  48.  
  49. 'It will write out the correct webbrowser object depending
  50.  
  51. 'on the browser version. To be sure it works, make sure you
  52.  
  53. 'include this script block in between the body tags.
  54.  
  55.  
  56.  
  57. if DA then
  58.  
  59. 'this must be IE4 or greater
  60.  
  61. wbvers="8856F961-340A-11D0-A96B-00C04FD705A2"
  62.  
  63. else
  64.  
  65. 'this must be IE3.x
  66.  
  67. wbvers="EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B"
  68.  
  69. end if
  70.  
  71.  
  72.  
  73. document.write ""
  74.  
  75. </SCRIPT>
Last edited by peter_budo; Jul 17th, 2009 at 2:21 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2175 | Replies: 5
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC