Results 1 to 2 of 2
  1. #1
    g.raaja is offline Member
    Join Date
    Dec 2009
    Rep Power

    Default problem with printing a barcode from jsp


    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.


  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power


    This has nothing to do with JSPs and everything to do with javascript and the printing mechanism associated with that.
    You might do better on a javascript forum?

Similar Threads

  1. Problem in printing
    By justbeller in forum Java 2D
    Replies: 0
    Last Post: 04-26-2011, 02:48 PM
  2. Replies: 0
    Last Post: 03-01-2011, 07:57 AM
  3. Replies: 0
    Last Post: 09-16-2010, 11:54 AM
  4. Printing problem
    By justlynn in forum NetBeans
    Replies: 5
    Last Post: 08-03-2010, 02:41 PM
  5. printing problem
    By ntpl in forum AWT / Swing
    Replies: 0
    Last Post: 11-27-2007, 11:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts