Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfReference


        PdfName.StemV,
        new PdfInteger(100)
        );
      // FontFile.
  //TODO:IMPL distinguish between truetype (FontDescriptor.FontFile2) and opentype (FontDescriptor.FontFile3 and FontStream.subtype=OpenType)!!!
      PdfReference fontFileReference = getFile().register(
        new PdfStream(
          new PdfDictionary(
            new PdfName[]{PdfName.Subtype},
            new PdfDirectObject[]{PdfName.OpenType}
            ),
View Full Code Here


    )
  {
    /*
      NOTE: 'Parent' entry may be undefined.
    */
    PdfReference parentObject = (PdfReference)getBaseDataObject().get(PdfName.Parent);
    if(parentObject == null)
      return null;

    return Annotation.wrap(parentObject);
  }
View Full Code Here

      return null;

    /*
      NOTE: key entry may be undefined.
    */
    PdfReference dependencyFilesObject = (PdfReference)dependenciesObject.get(key);
    if(dependencyFilesObject == null)
      return null;

    return new RelatedFiles(dependencyFilesObject,getContainer());
  }
View Full Code Here

      return null;

    /*
      NOTE: key entry may be undefined.
    */
    PdfReference embeddedFileObject = (PdfReference)embeddedFilesObject.get(key);
    if(embeddedFileObject == null)
      return null;

    return new EmbeddedFile(embeddedFileObject);
  }
View Full Code Here

    implicitly).</p>
  */
  public Resources getResources(
    )
  {
    PdfReference pagesReference = (PdfReference)getBaseDataObject().get(PdfName.Pages);
    return Resources.wrap(
      ((PdfDictionary)File.resolve(pagesReference)).get(PdfName.Resources),
      pagesReference.getIndirectObject()
      );
  }
View Full Code Here

  */
  public void setResources(
    Resources value
    )
  {
    PdfReference pages = (PdfReference)getBaseDataObject().get(PdfName.Pages);
    ((PdfDictionary)File.resolve(pages)).put(PdfName.Resources, value.getBaseObject());
  }
View Full Code Here

          getFile().unregister( // Removes the exceeding stream from the file.
            (PdfReference)streams.remove(1) // Removes the exceeding stream from the content stream.
            );
        }

        PdfReference streamReference = (PdfReference)streams.get(0);
        File.update(streamReference); // Updates the existing stream into the file.
        stream = (PdfStream)streamReference.getDataObject();
      }
    }

    // Get the stream buffer!
    IBuffer buffer = stream.getBody();
View Full Code Here

  // <private>
  private PrimitiveComposer createFilter(
    )
  {
    PdfReference reference = page.getFile().register(new PdfStream());

    return new PrimitiveComposer(
      new ContentScanner(
        new Contents(
          reference,
          reference.getIndirectObject(),
          page
          )
        )
      );
  }
View Full Code Here

      PdfDataObject dataObject = File.resolve(object);

      // 1. Evaluating the current object...
      if(object instanceof PdfReference)
      {
        PdfReference reference = (PdfReference)object;
        if(visitedReferences.contains(reference))
          return 0; // Avoids circular references.

        if(dataObject instanceof PdfDictionary
          && PdfName.Page.equals(((PdfDictionary)dataObject).get(PdfName.Type))
          && !isRoot)
          return 0; // Avoids references to other pages.

        visitedReferences.add(reference);

        // Calculate the data size of the current object!
        IOutputStream buffer = new Buffer();
        reference.getIndirectObject().writeTo(buffer);
        dataSize += buffer.getLength();
      }

      // 2. Evaluating the current object's children...
      Collection<PdfDirectObject> values = null;
View Full Code Here

    /*
      NOTE: We'll scan sequentially each page-tree level above this page object
      collecting page counts. At each level we'll scan the kids array from the
      lower-indexed item to the ancestor of this page object at that level.
    */
    PdfReference ancestorKidReference = (PdfReference)getBaseObject();
    PdfReference parentReference = (PdfReference)getBaseDataObject().get(PdfName.Parent);
    PdfDictionary parent = (PdfDictionary)File.resolve(parentReference);
    PdfArray kids = (PdfArray)File.resolve(parent.get(PdfName.Kids));
    int index = 0;
    for(
      int i = 0;
      true;
      i++
      )
    {
      PdfReference kidReference = (PdfReference)kids.get(i);
      // Is the current-level counting complete?
      // NOTE: It's complete when it reaches the ancestor at the current level.
      if(kidReference.equals(ancestorKidReference)) // Ancestor node.
      {
        // Does the current level correspond to the page-tree root node?
        if(!parent.containsKey(PdfName.Parent))
        {
          // We reached the top: counting's finished.
View Full Code Here

TOP

Related Classes of org.pdfclown.objects.PdfReference

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.