Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.TextField


   * @see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell,
   *      com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
   */
  public void cellLayout(PdfPCell cell, Rectangle position,
      PdfContentByte[] canvases) {
    TextField tf = new TextField(writer, position, fieldname);
    tf.setFontSize(12);
    try {
      PdfFormField field = tf.getTextField();
      writer.addAnnotation(field);
    } catch (IOException e) {
      e.printStackTrace();
    } catch (DocumentException e) {
      e.printStackTrace();
View Full Code Here


           
            // step 3: we open the document
            document.open();
           
            // step 4:
            TextField tf = new TextField(writer, new Rectangle(100, 300, 100 + 100, 300 + 50), "Dickens");
            tf.setBackgroundColor(Color.RED);
            tf.setBorderColor(Color.BLUE);
            tf.setBorderWidth(2);
            tf.setBorderStyle(PdfBorderDictionary.STYLE_BEVELED);
            tf.setText("It was the best of times, it was the worst of times, it was the age of wisdom...");
            tf.setAlignment(Element.ALIGN_CENTER);
            tf.setOptions(TextField.MULTILINE | TextField.REQUIRED);
            tf.setRotation(90);
            PdfFormField field = tf.getTextField();
            writer.addAnnotation(field);
           
            tf = new TextField(writer, new Rectangle(250, 300, 250 + 100, 300 + 20), "Combos");
            tf.setBackgroundColor(Color.RED);
            tf.setBorderColor(Color.BLUE);
            tf.setBorderWidth(2);
            tf.setFontSize(10);
            tf.setBorderStyle(PdfBorderDictionary.STYLE_INSET);
            tf.setVisibility(TextField.VISIBLE_BUT_DOES_NOT_PRINT);
            tf.setChoices(new String[]{"First", "Second"});
            tf.setChoiceExports(new String[]{"value1", "value2"});
            tf.setRotation(90);
            field = tf.getComboField();
            writer.addAnnotation(field);
           
            tf = new TextField(writer, new Rectangle(400, 300, 400 + 100, 300 + 50), "Lists");
            tf.setBackgroundColor(Color.YELLOW);
            tf.setBorderColor(Color.RED);
            tf.setBorderWidth(2);
            tf.setBorderStyle(PdfBorderDictionary.STYLE_DASHED);
            tf.setFontSize(10);
            tf.setChoices(new String[]{"a", "b", "c", "d", "e", "f", "g", "h"});
            tf.setRotation(90);
            tf.setChoiceSelection(4);
            field = tf.getListField();
            writer.addAnnotation(field);
           
        }
        catch(DocumentException de) {
            System.err.println(de.getMessage());
View Full Code Here

            ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, p2, 50, 550, 0);
            cb.endLayer();
            cb.beginLayer(l3);
            ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, p3, 50, 500, 0);
            cb.endLayer();
            TextField ff = new TextField(writer, new Rectangle(200, 600, 300, 620), "field1");
            ff.setBorderColor(Color.blue);
            ff.setBorderStyle(PdfBorderDictionary.STYLE_SOLID);
            ff.setBorderWidth(TextField.BORDER_WIDTH_THIN);
            ff.setText("I'm a form field");
            PdfFormField form = ff.getTextField();
            form.setLayer(l4);
            writer.addAnnotation(form);
            Image img = Image.getInstance("pngnow.png");
            img.setLayer(l4);
            img.setAbsolutePosition(200, 550);
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.TextField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.