Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PRStream


      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)
      return;
    byte b[] = PdfReader.getStreamBytes(prs);
    FileOutputStream fout = new FileOutputStream(fullPath);
    fout.write(b);
View Full Code Here


                  }else{
                    LOG.warn("Cannot overwrite "+fullPath.getAbsolutePath()+" (overwrite is false), unable to unpack.");
                  }   
            }       
          else{
            PRStream prs = (PRStream) PdfReader.getPdfObject(ef.get(PdfName.F));
            if (prs != null){
              byte b[] = PdfReader.getStreamBytes(prs);
              FileOutputStream fout = new FileOutputStream(fullPath);
              fout.write(b);
              fout.close();
View Full Code Here

    PdfObject contents = PdfReader.getPdfObject(page.get(PdfName.CONTENTS));
    if (contents != null) {
      this.add(new StreamTreeNode(contents, "Content"));
      if (contents.isStream()) {
        PRStream page_content = (PRStream) contents;

        Set s = page_content.getKeys();
        Iterator it = s.iterator();

        while (it.hasNext()) {
          Object obj = it.next();
          System.out.println("Field:" + obj);
          Object value = PdfReader.getPdfObject(page_content.get((PdfName) obj));
          System.out.println("Value:" + value);
        }
      }
    }
  }
View Full Code Here

    this.marker = marker;
  }

  public void updateview(UpdateNodeView updateobject) {
    if (contents.isStream()) {
      PRStream content_stream = (PRStream) contents;
      try {
        byte content[] = PdfReader.getStreamBytes(content_stream);
        updateobject.showtext(new String(content));
      } catch (IOException ex) {
      }
View Full Code Here

      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)
      return;
    byte b[] = PdfReader.getStreamBytes(prs);
    FileOutputStream fout = new FileOutputStream(fullPath);
    fout.write(b);
View Full Code Here

      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)
      return;
    byte b[] = PdfReader.getStreamBytes(prs);
    FileOutputStream fout = new FileOutputStream(fullPath);
    fout.write(b);
View Full Code Here

   * @throws IOException  usual exception when there's a problem writing to an OutputStream
   */
  public void writeTo(OutputStream os) throws IOException {
    Enumeration children = this.children();
    FormTreeNode node;
    PRStream stream;
    String key = null;
    String tmp = null;
    while (children.hasMoreElements()) {
      node = (FormTreeNode) children.nextElement();
      if (key != null) {
View Full Code Here

   * Renders the content stream of a PdfObject or empties the text area.
   * @param object  the object of which the content stream needs to be rendered
   */
  public void render(PdfObject object) {
    if (object instanceof PRStream) {
      PRStream stream = (PRStream)object;
      try {
        TextAreaOutputStream taos = new TextAreaOutputStream(text);
        taos.write(PdfReader.getStreamBytes(stream));
        //text.addMouseListener(new StreamEditorAction(stream));
      }
View Full Code Here

              final PRIndirectReference ref = (PRIndirectReference) contentObject;
              final PdfObject directObject = PdfReader.getPdfObject(ref);
              result = getContentBytesFromContentObject(directObject);
              break;
            case PdfObject.STREAM:
              final PRStream stream = (PRStream) PdfReader.getPdfObject(contentObject);
              result = PdfReader.getStreamBytes(stream);
              break;
            case PdfObject.ARRAY:
              // Stitch together all content before calling processContent(), because
              // processContent() resets state.
View Full Code Here

TOP

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

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.