+ Responder ao Tópico



  1. #1
    Brastemp
    alguem tem o barcode.class ai ?

  2. #2
    logan32
    Alguém tem componente de código de barras para delphi aí????
    Valew!



  3. Encontrei este código no GOOGLE

    The following code is an example of our java class library being used as a custom servlet:

    //*****************************************************************
    //
    // JAVA Servlet sample code for IDABarCode 2.1
    //
    // Copyright, IDAutomation.com, Inc. 2000. All rights reserved.
    //
    // <a href="http://www.IDAutomation.com/" target="_blank" target="_new">http://www.IDAutomation.com/</a>
    //
    // NOTICE:
    // You may incorporate our Source Code in your application
    // only if you own a valid Java Barcode Package License
    // from IDAutomation.com, Inc. and the copyright notices
    // are not removed from the source code.
    //
    // NOTE: "BarCode" is the class of the linear barcode class
    // For other classes such as PDF417, replace all text of "BarCode"
    // with "PDF417".
    //
    //*****************************************************************

    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import IDABarCode.*;
    import IDABarCode.encoder.*;
    import java.awt.Graphics2D.*;
    import java.awt.*;

    /** This is the Servlet class that contains code to create a bar code in a JPEG file from the server. */

    public class BarCodeServlet extends HttpServlet
    {

    /**
    * Handle the HTTP POST method by sending an e-mail
    *
    *
    */

    public void init() throws ServletException {

    }


    // MODIFY THIS FUNCTION TO CREATE THE BARCODE USING THE request PARAMETERS
    private BarCode getChart (HttpServletRequest request) {

    BarCode cb=new BarCode();

    cb.code="12345678901";
    cb.barType=cb.CODE128;

    return cb;


    }

    // Handle a request
    // 1. create barcode
    // 2. draw barcode in a Buffered Image
    // 3. encode image as JPEG and send it to the browser
    public void doGet (HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    {
    PrintWriter out;
    ServletOutputStream outb;

    response.setContentType("image/jpeg"- );

    //out=response.getWriter();
    outb=response.getOutputStream();

    // avoid caching in browser
    response.setHeader ("Pragma", "no-cache"- );
    response.setHeader ("Cache-Control", "no-cache"- );
    response.setDateHeader ("Expires",0);

    try { // Create buffer

    java.awt.image.BufferedImage BarImage=new java.awt.image.BufferedImage(500,500,java.awt.image.BufferedImage.TYPE_INT_RGB);
    java.awt.Graphics2D BarGraphics=BarImage.createGraphics();

    // get BarCode
    BarCode cb=getChart(request);
    cb.setSize(BarImage.getWidth(null),BarImage.getHeight(null));

    cb.paint(BarGraphics);

    // create JPEG image
    com.sun.image.codec.jpeg.JPEGImageEncoder encoder = com.sun.image.codec.jpeg.JPEGCodec.createJPEGEncoder(outb );
    encoder.encode( BarImage );


    } catch (Exception e) { e.printStackTrace();}

    //outb.close();

    }


    public void doPost (HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException
    {
    }

    }


    [ Esta mensagem foi editada por: Marcio68Almeida em 26-06-2003 11:20 ]






Tópicos Similares

  1. Nemero do Codigo de Barras da Homologação
    Por renanphp no fórum Redes
    Respostas: 0
    Último Post: 10-06-2008, 13:40
  2. Integracao php com leitor de codigo de barras
    Por jamba no fórum Linguagens de Programação
    Respostas: 1
    Último Post: 22-09-2006, 08:04
  3. Leitor de Código de barras Serial
    Por Valois no fórum Linguagens de Programação
    Respostas: 6
    Último Post: 23-11-2004, 19:00
  4. Onde encontro componente de código de barras para Delphi?!?!
    Por logan32 no fórum Linguagens de Programação
    Respostas: 4
    Último Post: 27-06-2003, 10:21
  5. php codigo de barra
    Por Brastemp no fórum Servidores de Rede
    Respostas: 1
    Último Post: 08-04-2003, 09:31

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L