Examples of PdfReference


Examples of org.pdfclown.objects.PdfReference

      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

Examples of org.pdfclown.objects.PdfReference

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

Examples of org.pdfclown.objects.PdfReference

      int i = 0;
      i < kids.size();
      i++
      )
    {
      PdfReference kidReference = (PdfReference)kids.get(i);
      PdfDictionary kid = (PdfDictionary)File.resolve(kidReference);
      // Is current kid a page object?
      if(kid.get(PdfName.Type).equals(PdfName.Page)) // Page object.
      {
        // Did we reach the searched position?
View Full Code Here

Examples of org.pdfclown.objects.PdfReference

            parent = (PdfDictionary)File.resolve(parent.get(PdfName.Parent));
            kids = (PdfArray)File.resolve(parent.get(PdfName.Kids));
          }
          else // Page subtree incomplete.
          {
            PdfReference kidReference = (PdfReference)kids.get(levelIndex);
            PdfDictionary kid = (PdfDictionary)File.resolve(kidReference);
            // Is current kid a page object?
            if(kid.get(PdfName.Type).equals(PdfName.Page)) // Page object.
            {
              // 2. Page found.
View Full Code Here

Examples of org.pdfclown.objects.PdfReference

    )
  {
    /*
      NOTE: 'IX' entry may be undefined (anyway, MUST be an indirect reference).
    */
    PdfReference alternateIconObject = (PdfReference)getBaseDataObject().get(PdfName.IX);
    if(alternateIconObject == null)
      return null;

    return new FormXObject(alternateIconObject);
  }
View Full Code Here

Examples of org.pdfclown.objects.PdfReference

    )
  {
    /*
      NOTE: 'I' entry may be undefined (anyway, MUST be an indirect reference).
    */
    PdfReference normalIconObject = (PdfReference)getBaseDataObject().get(PdfName.I);
    if(normalIconObject == null)
      return null;

    return new FormXObject(normalIconObject);
  }
View Full Code Here

Examples of org.pdfclown.objects.PdfReference

    )
  {
    /*
      NOTE: 'RI' entry may be undefined (anyway, MUST be an indirect reference).
    */
    PdfReference rolloverIconObject = (PdfReference)getBaseDataObject().get(PdfName.RI);
    if(rolloverIconObject == null)
      return null;

    return new FormXObject(rolloverIconObject);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.