Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfDictionary.containsKey()


      return null;

    PdfDictionary dataObject = (PdfDictionary)File.resolve(baseObject);
    PdfName actionType = (PdfName)dataObject.get(PdfName.S);
    if(actionType == null
      || (dataObject.containsKey(PdfName.Type)
          && !dataObject.get(PdfName.Type).equals(PdfName.Action)))
      return null;

    if(actionType.equals(PdfName.GoTo))
      return new GoToLocal(baseObject,container);
View Full Code Here


      // Is this data object a stream?
      if(dataObject instanceof PdfStream)
      {
        PdfDictionary header = ((PdfStream)dataObject).getHeader();
        // Is this stream an image?
        if(header.containsKey(PdfName.Type)
          && header.get(PdfName.Type).equals(PdfName.XObject)
          && header.get(PdfName.Subtype).equals(PdfName.Image))
        {
          // Which kind of image?
          if(header.get(PdfName.Filter).equals(PdfName.DCTDecode)) // JPEG image.
View Full Code Here

          for(int index = 0, length = entryFieldSizes.length; index < length; index++)
          {entryFieldSizes[index] = ((PdfInteger)entryFieldSizesObject.get(index)).getValue();}
        }

        final PdfArray subsectionBounds;
        if(header.containsKey(PdfName.Index))
        {subsectionBounds = (PdfArray)header.get(PdfName.Index);}
        else
        {
          subsectionBounds = new PdfArray();
          subsectionBounds.add(new PdfInteger(0));
View Full Code Here

      {kidObject = null;}
      else
      {kidObject = (PdfDictionary)((PdfReference)kidReferences.get(0)).getDataObject();}
      // Terminal field?
      if(kidObject == null // Merged single widget annotation.
        || (!kidObject.containsKey(PdfName.FT) // Multiple widget annotations.
          && kidObject.containsKey(PdfName.Subtype)
          && kidObject.get(PdfName.Subtype).equals(PdfName.Widget)))
      {values.add(Field.wrap(fieldReference));}
      else // Non-terminal field.
      {retrieveValues(kidReferences, values);}
View Full Code Here

      else
      {kidObject = (PdfDictionary)((PdfReference)kidReferences.get(0)).getDataObject();}
      // Terminal field?
      if(kidObject == null // Merged single widget annotation.
        || (!kidObject.containsKey(PdfName.FT) // Multiple widget annotations.
          && kidObject.containsKey(PdfName.Subtype)
          && kidObject.get(PdfName.Subtype).equals(PdfName.Widget)))
      {values.add(Field.wrap(fieldReference));}
      else // Non-terminal field.
      {retrieveValues(kidReferences, values);}
    }
View Full Code Here

  // <protected>
  protected Map<ByteArray,Integer> getNativeEncoding(
    )
  {
    PdfDictionary descriptor = getDescriptor();
    if(descriptor.containsKey(PdfName.FontFile)) // Embedded noncompact Type 1 font.
    {
      PdfStream fontFileStream = (PdfStream)descriptor.resolve(PdfName.FontFile);
      PfbParser parser = new PfbParser(fontFileStream.getBody());
      return parser.parse();
    }
View Full Code Here

    {
      PdfStream fontFileStream = (PdfStream)descriptor.resolve(PdfName.FontFile);
      PfbParser parser = new PfbParser(fontFileStream.getBody());
      return parser.parse();
    }
    else if(descriptor.containsKey(PdfName.FontFile3)) // Embedded compact Type 1 font.
    {
      PdfStream fontFileStream = (PdfStream)descriptor.resolve(PdfName.FontFile3);
      PdfName fontFileSubtype = (PdfName)fontFileStream.getHeader().get(PdfName.Subtype);
      if(fontFileSubtype.equals(PdfName.Type1C)) // CFF.
      {throw new NotImplementedException("Embedded CFF font file.");}
View Full Code Here

    if(fontType == null)
      throw new RuntimeException("Font type undefined (reference: " + reference + ")");

    if(fontType.equals(PdfName.Type1)) // Type 1.
    {
      if(!fontDictionary.containsKey(PdfName.FontDescriptor)) // Standard Type 1.
        return new StandardType1Font(reference);
      else // Custom Type 1.
      {
        PdfDictionary fontDescriptor = (PdfDictionary)fontDictionary.resolve(PdfName.FontDescriptor);
        if(fontDescriptor.containsKey(PdfName.FontFile3)
View Full Code Here

      if(!fontDictionary.containsKey(PdfName.FontDescriptor)) // Standard Type 1.
        return new StandardType1Font(reference);
      else // Custom Type 1.
      {
        PdfDictionary fontDescriptor = (PdfDictionary)fontDictionary.resolve(PdfName.FontDescriptor);
        if(fontDescriptor.containsKey(PdfName.FontFile3)
            && ((PdfName)((PdfStream)fontDescriptor.resolve(PdfName.FontFile3)).getHeader().resolve(PdfName.Subtype)).equals(PdfName.OpenType)) // OpenFont/CFF.
          throw new NotImplementedException();
        else // Non-OpenFont Type 1.
          return new Type1Font(reference);
      }
View Full Code Here

      // 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.
          return index;
        }
        // Set the ancestor at the next level!
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.