Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfName


  /**
   * Sets the value of the collection item.
   * @param value
   */
  public void addItem(String key, PdfString value) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    if (field.fieldType == PdfCollectionField.TEXT) {
      put(fieldname, value);
    }
  }
View Full Code Here


  /**
   * Sets the value of the collection item.
   * @param d
   */
  public void addItem(String key, PdfDate d) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    if (field.fieldType == PdfCollectionField.DATE) {
      put(fieldname, d);
    }
  }
View Full Code Here

  /**
   * Sets the value of the collection item.
   * @param n
   */
  public void addItem(String key, PdfNumber n) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    if (field.fieldType == PdfCollectionField.NUMBER) {
      put(fieldname, n);
    }
  }
View Full Code Here

   * Adds a prefix for the Collection item.
   * You can only use this method after you have set the value of the item.
   * @param prefix  a prefix
   */
  public void setPrefix(String key, String prefix) {
    PdfName fieldname = new PdfName(key);
    PdfObject o = get(fieldname);
    if (o == null)
      throw new IllegalArgumentException("You must set a value before adding a prefix.");
    PdfDictionary dict = new PdfDictionary(PdfName.COLLECTIONSUBITEM);
    dict.put(PdfName.D, o);
View Full Code Here

   * Adds a Collection field to the Schema.
   * @param name  the name of the collection field
   * @param field  a Collection Field
   */
  public void addField(String name, PdfCollectionField field) {
    put(new PdfName(name), field);
  }
View Full Code Here

        this(os);
        if (info != null) {
          DublinCoreSchema dc = new DublinCoreSchema();
          PdfSchema p = new PdfSchema();
          XmpBasicSchema basic = new XmpBasicSchema();
          PdfName key;
          PdfObject obj;
          for (Iterator it = info.getKeys().iterator(); it.hasNext();) {
            key = (PdfName)it.next();
            obj = info.get(key);
            if (obj == null)
View Full Code Here

   * Constructs a PDF Collection Sort Dictionary.
   * @param key  the key of the field that will be used to sort entries
   */
  public PdfCollectionSort(String key) {
    super(PdfName.COLLECTIONSORT);
    put(PdfName.S, new PdfName(key));
  }
View Full Code Here

   */
  public PdfCollectionSort(String[] keys) {
    super(PdfName.COLLECTIONSORT);
    PdfArray array = new PdfArray();
    for (int i = 0; i < keys.length; i++) {
      array.add(new PdfName(keys[i]));
    }
    put(PdfName.S, array);
  }
View Full Code Here

  /**
   * Sets the value of the collection item.
   * @param value
   */
  public void addItem(String key, String value) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    put(fieldname, field.getValue(value));
  }
View Full Code Here

  /**
   * Sets the value of the collection item.
   * @param value
   */
  public void addItem(String key, PdfString value) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    if (field.type == PdfCollectionField.TEXT) {
      put(fieldname, value);
    }
  }
View Full Code Here

TOP

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

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.