954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

printing at client side without print dialog box

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 ..

Poojasrivastava
Newbie Poster
13 posts since Apr 2009
Reputation Points: 11
Solved Threads: 0
 

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/showthread.php?t=85301

sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
 
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Try the solution given by Andy0000 in the following link: http://www.webdeveloper.com/forum/archive/index.php/t-174029.html

But it may work in IE only.

Ramesh S
Posting Pro
583 posts since Jun 2009
Reputation Points: 165
Solved Threads: 113
 

Use an ActiveX or Plugin ScriptX and Neptune from Meadroid to give you more control for Windows versions of Internet Explorer, Netscape, and Opera.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

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!!!!!!! **

<body onload="window.print();">

<OBJECT Classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0></OBJECT>   

<SCRIPT LANGUAGE="JavaScript">

DA = (document.all) ? 1 : 0

</SCRIPT>

<SCRIPT LANGUAGE="VBScript">

sub print() 

        OLECMDID_PRINT = 6

        OLECMDEXECOPT_DONTPROMPTUSER = 2

        OLECMDEXECOPT_PROMPTUSER = 1 

        'on error resume next

 

          'IE4 object has different command structure

        if DA then

              call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)

 

        else

              call WB.IOleCommandTarget.Exec(OLECMDID_PRINT ,OLECMDEXECOPT_DONTPROMPTUSER,"","")

 

        end if

 

end sub

 

'This will be interpreted during loading.

'It will write out the correct webbrowser object depending

'on the browser version. To be sure it works, make sure you

'include this script block in between the body tags.

 

if DA then

        'this must be IE4 or greater

        wbvers="8856F961-340A-11D0-A96B-00C04FD705A2"

else

        'this must be IE3.x

        wbvers="EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B"

end if

 

document.write  ""

</SCRIPT>
adamself
Newbie Poster
1 post since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

Please Help! this command prints a page 2 times, i need the page to be printed once. how to do so?

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!!!!!!! **

<body onload="window.print();">

<OBJECT Classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0></OBJECT>   

<SCRIPT LANGUAGE="JavaScript">

DA = (document.all) ? 1 : 0

</SCRIPT>

<SCRIPT LANGUAGE="VBScript">

sub print() 

        OLECMDID_PRINT = 6

        OLECMDEXECOPT_DONTPROMPTUSER = 2

        OLECMDEXECOPT_PROMPTUSER = 1 

        'on error resume next

 

          'IE4 object has different command structure

        if DA then

              call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)

 

        else

              call WB.IOleCommandTarget.Exec(OLECMDID_PRINT ,OLECMDEXECOPT_DONTPROMPTUSER,"","")

 

        end if

 

end sub

 

'This will be interpreted during loading.

'It will write out the correct webbrowser object depending

'on the browser version. To be sure it works, make sure you

'include this script block in between the body tags.

 

if DA then

        'this must be IE4 or greater

        wbvers="8856F961-340A-11D0-A96B-00C04FD705A2"

else

        'this must be IE3.x

        wbvers="EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B"

end if

 

document.write  ""

</SCRIPT>
rohit.ss
Newbie Poster
1 post since Jan 2010
Reputation Points: 10
Solved Threads: 0
 
pauldani
Light Poster
49 posts since Jan 2010
Reputation Points: 8
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You