Problem in Printing using php and javascript

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

khanshahbaz06
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Jan 08, 2013 10:39 pm

Problem in Printing using php and javascript

Postby khanshahbaz06 » Tue Jan 08, 2013 10:46 pm

HI, I am trying to print barcode using javascript. The code is
<script language="JavaScript" type="text/javascript">
function printContent(div_id)
{
var DocumentContainer = document.getElementById(div_id);
var html = '<html><head>'+
'<link href="css/template.css" rel="stylesheet" type="text/css" />'+
'</head><body style="background:#ffffff;"><br><br>'+
DocumentContainer.innerHTML+
'</body></html>';
var WindowObject = window.open("", "PrintWindow",
"width=300,height=200,top=150,left=500,toolbars=no,scrollbars=yes,status=no,resizable=yes");
WindowObject.document.writeln(html);
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
document.getElementById('print_link').style.display='block';
//self.close();
}
</script >


This works fine when i take print from normal printer. But when I tried it with my Oniel portable bluetooth printer, it didn't work. Please Help.

Return to “PHP coding => General”

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron