_______
| |
| |
|______|
_______
| |
| |
|______|
y poderle agregar en vez del valor fijo un codigo de barras
Código Java:
Ver original
import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import java.awt.print.Book; import java.awt.print.PageFormat; import java.awt.print.Printable; import java.awt.print.PrinterJob; public class JavaWorldPrintExample3 { JavaWorldPrintExample3 example3 = new JavaWorldPrintExample3(); } private final static int POINTS_PER_INCH = 72; public JavaWorldPrintExample3() { book.append(new IntroPage(), printJob.defaultPage()); printJob.setPageable(book); if (printJob.printDialog()) { try { printJob.print(); PrintException.printStackTrace(); } } } g2d.translate(pageFormat.getImageableX(), pageFormat .getImageableY()); g2d.draw(border); g2d2.draw(border2); g2d.setFont(titleFont); g2d2.setFont(titleFont2); double titleX = (68 / 2)-(39 / 2); double valor=POINTS_PER_INCH/24.5; double val=valor*14; double titleY = val/2; double titleX2 = (68 / 2)-(39 / 2); double valor2=POINTS_PER_INCH/24.5; double val2=valor2*14; double titleY2 = val2/2; g2d.drawString(titleText, (int) titleX, (int) titleY); g2d2.drawString(titleText2, (int) titleX2, (int) titleY2); return (PAGE_EXISTS); } } }
si alguien me pudiera ayudar gracias