Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfString


  /**
   * Sets the Well Known Text.
   * @param wkt a String that will be converted to a PdfString in ASCII.
   */
  public void setWKT(String wkt) {
    super.put(PdfName.WKT, new PdfString(wkt));
  }
View Full Code Here


    PdfObject o = get(fieldname);
    if (o == null)
      throw new IllegalArgumentException(MessageLocalization.getComposedMessage("you.must.set.a.value.before.adding.a.prefix"));
    PdfDictionary dict = new PdfDictionary(PdfName.COLLECTIONSUBITEM);
    dict.put(PdfName.D, o);
    dict.put(PdfName.P, new PdfString(prefix, PdfObject.TEXT_UNICODE));
    put(fieldname, dict);
  }
View Full Code Here

           case Annotation.NAMED_DEST:
               return new PdfAnnotation(writer, annot.llx(), annot.lly(), annot.urx(), annot.ury(), new PdfAction(((Integer) annot.attributes().get(Annotation.NAMED)).intValue()));
           case Annotation.LAUNCH:
               return new PdfAnnotation(writer, annot.llx(), annot.lly(), annot.urx(), annot.ury(), new PdfAction((String) annot.attributes().get(Annotation.APPLICATION),(String) annot.attributes().get(Annotation.PARAMETERS),(String) annot.attributes().get(Annotation.OPERATION),(String) annot.attributes().get(Annotation.DEFAULTDIR)));
           default:
             return new PdfAnnotation(writer, defaultRect.getLeft(), defaultRect.getBottom(), defaultRect.getRight(), defaultRect.getTop(), new PdfString(annot.title(), PdfObject.TEXT_UNICODE), new PdfString(annot.content(), PdfObject.TEXT_UNICODE));
       }
   }
View Full Code Here

   * If this dictionary refers to a child that is a document level attachment,
   * you need to specify the name that was used to attach the document.
   * @param  target  the name in the EmbeddedFiles name tree
   */
  public void setEmbeddedFileName(String target) {
    put(PdfName.N, new PdfString(target, null));
  }
View Full Code Here

   * you need to specify the name of the page (or use setFileAttachmentPage to specify the page number).
   * Once you have specified the page, you still need to specify the attachment using another method.
   * @param name  the named destination referring to the page with the file attachment.
   */
  public void setFileAttachmentPagename(String name) {
    put(PdfName.P, new PdfString(name, null));
  }
View Full Code Here

   * you need to specify the page with setFileAttachmentPage or setFileAttachmentPageName,
   * and then specify the name of the attachment added to this page (or use setFileAttachmentIndex).
   * @param name    the name of the attachment
   */
  public void setFileAttachmentName(String name) {
    put(PdfName.A, new PdfString(name, PdfObject.TEXT_UNICODE));
  }
View Full Code Here

   * @param name    the field name
   * @param type    the field type
   */
  public PdfCollectionField(String name, int type) {
    super(PdfName.COLLECTIONFIELD);
    put(PdfName.N, new PdfString(name, PdfObject.TEXT_UNICODE));
    this.fieldType = type;
    switch(type) {
    default:
      put(PdfName.SUBTYPE, PdfName.S);
      break;
View Full Code Here

   * @param v  value  the value that has to be changed into a PdfObject (PdfString, PdfDate or PdfNumber
   */
  public PdfObject getValue(String v) {
    switch(fieldType) {
    case TEXT:
      return new PdfString(v, PdfObject.TEXT_UNICODE);
    case DATE:
      return new PdfDate(PdfDate.decode(v));
    case NUMBER:
      return new PdfNumber(v);
    }
View Full Code Here

   * Identifies the document that will be initially presented
   * in the user interface.
   * @param description  the description that was used when attaching the file to the document
   */
  public void setInitialDocument(String description) {
    put(PdfName.D, new PdfString(description, null));
  }
View Full Code Here

   
    public void completeInfoDictionary(PdfDictionary info) {
        if (isPdfX() && !isPdfA1()) {
            if (info.get(PdfName.GTS_PDFXVERSION) == null) {
                if (isPdfX1A2001()) {
                    info.put(PdfName.GTS_PDFXVERSION, new PdfString("PDF/X-1:2001"));
                    info.put(new PdfName("GTS_PDFXConformance"), new PdfString("PDF/X-1a:2001"));
                }
                else if (isPdfX32002())
                    info.put(PdfName.GTS_PDFXVERSION, new PdfString("PDF/X-3:2002"));
            }
            if (info.get(PdfName.TITLE) == null) {
                info.put(PdfName.TITLE, new PdfString("Pdf document"));
            }
            if (info.get(PdfName.CREATOR) == null) {
                info.put(PdfName.CREATOR, new PdfString("Unknown"));
            }
            if (info.get(PdfName.TRAPPED) == null) {
                info.put(PdfName.TRAPPED, new PdfName("False"));
            }
        }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.pdf.PdfString

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.