List of usage examples for com.itextpdf.text.pdf Barcode39 setStartStopText
public void setStartStopText(boolean startStopText)
From source file:fc.extensions.itext.Writer.java
License:MIT License
public void writeBarcode(String barcode, float leftX, float bottomY, float scalePercent, boolean isShowCode) throws Exception { Barcode39 code39 = new Barcode39(); code39.setStartStopText(false); code39.setTextAlignment(PdfContentByte.ALIGN_LEFT); if (!isShowCode) { code39.setFont(null);//from w w w . j a v a2s .co m } code39.setCode(barcode); Image image = code39.createImageWithBarcode(pdfWriterCB, this.baseColor, this.baseColor); image.setAbsolutePosition(leftX, bottomY); image.scalePercent(scalePercent); pdfWriterCB.addImage(image); }
From source file:org.com.controller.BarcodeController.java
@RequestMapping(value = "/barprocess", method = RequestMethod.POST) public void barpdfgen(@ModelAttribute(value = "quick") BargenTemp bt, Model m, HttpServletResponse response, HttpServletRequest request, OutputStream outputStream) throws Exception { System.out.println("on process" + bt.getIsbn()); if ("".equals(bt.getIsbn())) { System.out.println("on process 2"); response.setContentType("application/pdf"); response.setHeader("Content-Disposition", "attachment; filename= barcode"); Document document = new Document(new Rectangle(340, 842)); PdfWriter writer = PdfWriter.getInstance(document, outputStream); document.open();// w w w . j ava2 s . c om PdfContentByte cb = writer.getDirectContent(); int q = Integer.parseInt(bt.getQuantity()); System.out.println("QUANTITU" + q); document.add(new Paragraph("Cod-39: DATE: " + bt.getDate())); document.add(new Paragraph("==========================================")); document.add(new Paragraph(" ")); PdfPTable table = new PdfPTable(5); for (int i = 0; i <= q; i++) { Barcode39 code39ext = new Barcode39(); code39ext.setCode(bt.getBno()); code39ext.setStartStopText(false); code39ext.setExtended(true); table.addCell(code39ext.createImageWithBarcode(cb, null, null)); } document.add(table); // step 5 document.close(); autocomplete(bt); //return "null"; } }
From source file:org.unesco.jisis.printsort.BarCodeGenerator.java
/** * Method to create barcode image of type Barcode39 for mytext */// ww w.ja va 2 s .com public Image createBarCode39(String myText) { /** * Code 39 character set consists of barcode symbols representing * characters 0-9, A-Z, the space character and the following symbols: * - . $ / + % */ Barcode39 myBarCode39 = new Barcode39(); myBarCode39.setCode(myText); myBarCode39.setStartStopText(false); Image myBarCodeImage39 = myBarCode39.createImageWithBarcode(contentByte, null, null); return myBarCodeImage39; }
From source file:org.unesco.jisis.printsort.BarCodeGenerator.java
/**Creating a barcode image using Barcode39 extended type for myText*/ public Image createBarcode39Extended(String myText) { Barcode39 myBarCode39extended = new Barcode39(); myBarCode39extended.setCode(myText); myBarCode39extended.setStartStopText(false); myBarCode39extended.setExtended(true); Image myBarCodeImage39Extended = myBarCode39extended.createImageWithBarcode(contentByte, null, null); return myBarCodeImage39Extended; }