• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with printing a barcode from jsp

Raaja Gotluru
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am facing problem in priniting bar code from a jsp through barcode printer. The barcode sticker size is 4in x 4in. Whenever I call window.print() in jsp its trying to print a size of letter which is wasting three stickers. I want to set the the page size to 4x4 inches. How to do it? Somebody help me.

My code is:
<style media="print" type="text/css">
#printable { display: none; }
@media print
body * { visibility: hidden; }
#PrintDiv * { visibility: visible; }
#PrintDiv { position: absolute; top: 40px; left: 30px; }
#non-printable { display: none; }
#printable { display: block; }
size: 288px 288px;
<% String barcodegen = (String)request.getAttribute("barcode");%>

<div id="PrintDiv" style="visibility:hidden;page-break-after:always;width:10;
height:10" class="">
<p >
<object type="image/svg+xml" data="<%=barcodegen%>&ext=.svg" name="DynamicBarcode" ></object>

<% if(barcodegen!=null){ %>

<% }%>
Help me in setting paper size.

Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic