Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfName


    Gets the transition orientation.
  */
  public OrientationEnum getOrientation(
    )
  {
    PdfName orientationObject = (PdfName)getBaseDataObject().get(PdfName.Dm);
    return orientationObject == null
      ? OrientationEnum.Horizontal
      : OrientationEnum.get(orientationObject);
  }
View Full Code Here


    Gets the transition direction on page.
  */
  public PageDirectionEnum getPageDirection(
    )
  {
    PdfName pageDirectionObject = (PdfName)getBaseDataObject().get(PdfName.M);
    return pageDirectionObject == null
      ? PageDirectionEnum.Inward
      : PageDirectionEnum.get(pageDirectionObject);
  }
View Full Code Here

    Gets the transition style.
  */
  public StyleEnum getStyle(
    )
  {
    PdfName styleObject = (PdfName)getBaseDataObject().get(PdfName.S);
    return styleObject == null
      ? StyleEnum.Replace
      : StyleEnum.get(styleObject);
  }
View Full Code Here

      NOTE: This is necessary to keep the reference to the on-state name.
    */
    Appearance appearance = new Appearance(page.getDocument());
    setAppearance(appearance);
    AppearanceStates normalAppearance = appearance.getNormal();
    normalAppearance.put(new PdfName(widgetName),new FormXObject(page.getDocument()));
  }
View Full Code Here

  public String getWidgetName(
    )
  {
    for(Map.Entry<PdfName,FormXObject> normalAppearanceEntry : getAppearance().getNormal().entrySet())
    {
      PdfName key = normalAppearanceEntry.getKey();
      if(!key.equals(PdfName.Off)) // 'On' state.
        return (String)key.getValue();
    }

    return null; // NOTE: It MUST NOT happen (on-state should always be defined).
  }
View Full Code Here

      if(cache.containsKey(reference))
        return (Font)cache.get(reference);
    }

    PdfDictionary fontDictionary = (PdfDictionary)reference.getDataObject();
    PdfName fontType = (PdfName)fontDictionary.get(PdfName.Subtype);
    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)
            && ((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);
      }
    }
    else if(fontType.equals(PdfName.TrueType)) // TrueType.
      return new TrueTypeFont(reference);
    else if(fontType.equals(PdfName.Type0)) // OpenFont.
    {
      PdfDictionary cidFontDictionary = (PdfDictionary)((PdfArray)fontDictionary.resolve(PdfName.DescendantFonts)).resolve(0);
      PdfName cidFontType = (PdfName)cidFontDictionary.get(PdfName.Subtype);
      if(cidFontType.equals(PdfName.CIDFontType0)) // OpenFont/CFF.
        return new Type0Font(reference);
      else if(cidFontType.equals(PdfName.CIDFontType2)) // OpenFont/TrueType.
        return new Type2Font(reference);
      else
        throw new NotImplementedException("Type 0 subtype " + cidFontType + " not supported yet.");
    }
    else if(fontType.equals(PdfName.Type3)) // Type 3.
View Full Code Here

    )
  {
    /*
      NOTE: 'Sy' entry may be undefined.
    */
    PdfName symbolObject = (PdfName)getBaseDataObject().get(PdfName.Sy);
    if(symbolObject == null)
      return SymbolTypeEnum.None;

    return SymbolTypeEnum.get(symbolObject);
  }
View Full Code Here

    Gets the destination mode.
  */
  public ModeEnum getMode(
    )
  {
    PdfName modeObject = (PdfName)getBaseDataObject().get(1);
    if(modeObject.equals(PdfName.FitB))
      return ModeEnum.FitBoundingBox;
    else if(modeObject.equals(PdfName.FitBH))
      return ModeEnum.FitBoundingBoxHorizontal;
    else if(modeObject.equals(PdfName.FitBV))
      return ModeEnum.FitBoundingBoxVertical;
    else if(modeObject.equals(PdfName.FitH))
      return ModeEnum.FitHorizontal;
    else if(modeObject.equals(PdfName.FitR))
      return ModeEnum.FitRectangle;
    else if(modeObject.equals(PdfName.FitV))
      return ModeEnum.FitVertical;
    else if(modeObject.equals(PdfName.XYZ))
      return ModeEnum.XYZ;
    else
      return ModeEnum.Fit;
  }
View Full Code Here

    )
  {
    /*
      NOTE: 'Name' entry may be undefined.
    */
    PdfName nameObject = (PdfName)getBaseDataObject().get(PdfName.Name);
    if(nameObject == null)
      return IconTypeEnum.Draft;

    return IconTypeEnum.get(nameObject);
  }
View Full Code Here

      NOTE: This is a factory method for any xobject-derived object.
    */
    if(reference == null)
      return null;

    PdfName subtype = (PdfName)((PdfStream)reference.getDataObject()).getHeader().get(PdfName.Subtype);
    if(subtype.equals(PdfName.Form))
      return new FormXObject(reference);
    else if(subtype.equals(PdfName.Image))
      return new ImageXObject(reference);
    else
      return null;
  }
View Full Code Here

TOP

Related Classes of org.pdfclown.objects.PdfName

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.