Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfString


      byte[] paddedSig = new byte[contentEstimated];
      System.arraycopy(encodedSig, 0, paddedSig, 0, encodedSig.length);

      PdfDictionary dic2 = new PdfDictionary();
      dic2.put(PdfName.CONTENTS, new PdfString(paddedSig).setHexWriting(true));
      options.log("console.closeStream");
      sap.close(dic2);
      fout.close();

    } catch (Exception e) {
View Full Code Here


    int retVal = 0;
    if (filespec != null){
      PdfName type = (PdfName) PdfReader.getPdfObject(filespec.get(PdfName.TYPE));
      if (PdfName.F.equals(type) || PdfName.FILESPEC.equals(type)){
        PdfDictionary ef = (PdfDictionary) PdfReader.getPdfObject(filespec.get(PdfName.EF));
        PdfString fn = (PdfString) PdfReader.getPdfObject(filespec.get(PdfName.F));
        if (fn != null && ef != null){
          LOG.debug("Unpacking file " + fn + " to " + outPath);
          File fLast = new File(fn.toUnicodeString());
          File fullPath = new File(outPath, fLast.getName());
          if (fullPath.exists()){
                  //check if overwrite is allowed
                  if (overwrite){
                      if(!fullPath.delete()){
View Full Code Here

            if (l.get(PdfName.WIN) != null) {
              System.out.println("Removed: " + l.get(PdfName.WIN));
              l.remove(PdfName.WIN);
            }
            l.put(PdfName.S, PdfName.JAVASCRIPT);
            l.put(PdfName.JS, new PdfString("app.alert('Launch Application Action removed by iText');\r"));
          }
        }
      }
      PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
      stamper.close();
View Full Code Here

  protected void iterateOutlines(PdfDictionary outlines, PdfReader pdfreader,
      DefaultMutableTreeNode node) {
    DefaultMutableTreeNode leaf;
    PdfDictionary kid = outlines;
    do {
      PdfString title = (PdfString) PdfReader.getPdfObject(kid.get(PdfName.TITLE));
      leaf = new BookmarksTreeNode(title, kid);
      node.add(leaf);
      PdfDictionary first = (PdfDictionary) PdfReader.getPdfObject(kid.get(PdfName.FIRST));
      if (first != null) {
        iterateOutlines(first, pdfreader, leaf);
View Full Code Here

      return;
    PdfDictionary ef = (PdfDictionary) PdfReader.getPdfObject(filespec
        .get(PdfName.EF));
    if (ef == null)
      return;
    PdfString fn = (PdfString) PdfReader.getPdfObject(filespec
        .get(PdfName.F));
    System.out.println("Unpacking file '" + fn + "' to " + outPath);
    if (fn == null)
      return;
    File fLast = new File(fn.toUnicodeString());
    File fullPath = new File(outPath, fLast.getName());
    if (fullPath.exists())
      return;
    PRStream prs = (PRStream) PdfReader.getPdfObject(ef.get(PdfName.F));
    if (prs == null)
View Full Code Here

                    }
                    PdfArray indexed = new PdfArray();
                    indexed.add(PdfName.INDEXED);
                    indexed.add(PdfName.DEVICERGB);
                    indexed.add(new PdfNumber(gColor - 1));
                    indexed.add(new PdfString(palette));
                    PdfDictionary additional = new PdfDictionary();
                    additional.put(PdfName.COLORSPACE, indexed);
                    img.setAdditional(additional);
                }
                img.setOriginalType(LwgImage.ORIGINAL_TIFF);
View Full Code Here

            PdfArray colorspace = new PdfArray();
            colorspace.add(PdfName.INDEXED);
            colorspace.add(PdfName.DEVICERGB);
            int len = m_curr_table.length;
            colorspace.add(new PdfNumber(len / 3 - 1));
            colorspace.add(new PdfString(m_curr_table));
            PdfDictionary ad = new PdfDictionary();
            ad.put(PdfName.COLORSPACE, colorspace);
            img.setAdditional(ad);
            if (transparency) {
                img.setTransparency(new int[]{transIndex, transIndex});
View Full Code Here

        colorspace.add(PdfName.INDEXED);
        colorspace.add(PdfName.DEVICERGB);
        byte np[] = getPalette(paletteEntries);
        int len = np.length;
        colorspace.add(new PdfNumber(len / 3 - 1));
        colorspace.add(new PdfString(np));
        PdfDictionary ad = new PdfDictionary();
        ad.put(PdfName.COLORSPACE, colorspace);
        img.setAdditional(ad);
        return img;
    }
View Full Code Here

                    colorspace.add(new PdfNumber(len / 3 - 1));
                    ByteBuffer colortable = new ByteBuffer();
                    while ((len--) > 0) {
                        colortable.append_i(is.read());
                    }
                    colorspace.add(new PdfString(colorTable = colortable.toByteArray()));
                    additional.put(PdfName.COLORSPACE, colorspace);
                }
                else {
                    Utilities.skip(is, len);
                }
View Full Code Here

      writer.setFullCompression();

      while (e.hasMoreElements())  {

          String key = (String) e.nextElement() ;
          PdfString val = new PdfString(headerTags.getProperty(key), PdfObject.TEXT_UNICODE);

          PdfDictionary dictionary = writer.getInfo();
         
          if (key.equals("title" )) {
            dictionary.put(PdfName.TITLE, val);
View Full Code Here

TOP

Related Classes of com.lowagie.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.