Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfString


            sout = decodeStringToByte((PdfString)code);
        int start = a1[a1.length - 1] & 0xff;
        int end = a2[a2.length - 1] & 0xff;
        for (int k = start; k <= end; ++k) {
            a1[a1.length - 1] = (byte)k;
            PdfString s = new PdfString(a1);
            s.setHexWriting(true);
            if (code instanceof PdfArray) {
                addChar(s, ((PdfArray)code).getPdfObject(k - start));
            }
            else if (code instanceof PdfNumber) {
                int nn = ((PdfNumber)code).intValue() + k - start;
                addChar(s, new PdfNumber(nn));
            }
            else if (code instanceof PdfString) {
                PdfString s1 = new PdfString(sout);
                s1.setHexWriting(true);
                ++sout[sout.length - 1];
                addChar(s, s1);
            }
        }
    }
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

        }
      }
      // replace the existing attributes by a PrintField attribute
      PdfDictionary attribute = new PdfDictionary();
      attribute.put(PdfName.O, PdfName.PRINTFIELD);
      PdfString description = dict.getAsString(PdfName.TU);
      if (description == null)
        description = dict.getAsString(PdfName.T);
      if (PdfName.BTN.equals(dict.get(PdfName.FT))) {
        PdfNumber fflags = dict.getAsNumber(PdfName.FF);
        if (fflags != null) {
          int ff = fflags.intValue();
                if ((ff & PdfFormField.FF_PUSHBUTTON) != 0)
                    attribute.put(PdfName.ROLE, PdfName.PB);
                // I don't think the condition below will ever be true
                if ((ff & PdfFormField.FF_RADIO) != 0)
                    attribute.put(PdfName.ROLE, PdfName.rb);
                else
                    attribute.put(PdfName.ROLE, PdfName.CB);
        }
      }
      else {
        attribute.put(PdfName.ROLE, PdfName.TV);
      }
      attribute.put(PdfName.DESC, description);
      // Updating the values of the StructElem dictionary
      PdfString t = structElem.getAsString(PdfName.T);
      if (t == null || t.toString().trim().length() == 0)
        structElem.put(PdfName.T, dict.getAsString(PdfName.T));
      structElem.put(PdfName.A, attribute);
      structElem.put(PdfName.S, PdfName.P);
      structElem.put(PdfName.PG, pageref);
      // Defining a new MCID
View Full Code Here

   * @return  true if the dictionary should be removed
   */
  private boolean isToBeRemoved(PdfDictionary ocg, Set<String> names) {
    if (ocg == null)
      return false;
    PdfString n = ocg.getAsString(PdfName.NAME);
    if (n == null)
      return false;
    return names.contains(n.toString());
  }
View Full Code Here

  /**
   * 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

      properties = resources.getAsDict(PdfName.PROPERTIES);
      xobj = new HashSet<PdfName>();
      PdfDictionary xobjects = resources.getAsDict(PdfName.XOBJECT);
      PRStream xobject;
      PdfDictionary oc;
      PdfString ocname;
    if (xobjects != null) {
      // remove XObject (form or image) that belong to an OCG that needs to be removed
      for (PdfName name : xobjects.getKeys()) {
        xobject = (PRStream)xobjects.getAsStream(name);
        oc = xobject.getAsDict(PdfName.OC);
        if (oc != null) {
          ocname = oc.getAsString(PdfName.NAME);
          if (ocname != null && ocgs.contains(ocname.toString())) {
            xobj.add(name);
          }
        }
      }
      for (PdfName name : xobj) {
View Full Code Here

      if (properties == null)
        return;
      PdfDictionary ocdict = properties.getAsDict(ocref);
      if (ocdict == null)
        return;
      PdfString ocname = ocdict.getAsString(PdfName.NAME);
      if (ocname == null)
        return;
      if (ocgs.contains(ocname.toString()))
        mc_balance++;
    }
View Full Code Here

   * Sets a text string containing formatted name value pairs passed
   * to the Flash Player context when activated.
   * @param  flashVars  a String with the Flash variables
   */
  public void setFlashVars(String flashVars) {
    put(PdfName.FLASHVARS, new PdfString(flashVars));
  }
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

   * 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

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.