Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfArray


    float unitsOff
    )
  {
    super(
      Operator,
      new PdfArray(
        new PdfReal(unitsOn),
        new PdfReal(unitsOff)
        ),
      new PdfReal(phase)
      );
View Full Code Here


  public LineDash getValue(
    )
  {
    // 1. Dash array.
    PdfArray baseDashArray = (PdfArray)operands.get(0);
    float[] dashArray = new float[baseDashArray.size()];
    for(
      int index = 0,
        length = dashArray.length;
      index < length;
      index++
      )
    {dashArray[index] = ((PdfNumber<?>)baseDashArray.get(index)).getNumberValue();}
    // 2. Dash phase.
    float dashPhase = ((PdfNumber<?>)operands.get(1)).getNumberValue();

    return new LineDash(dashArray, dashPhase);
  }
View Full Code Here

    LineDash value
    )
  {
    // 1. Dash array.
    float[] dashArray = value.getDashArray();
    PdfArray baseDashArray = new PdfArray(dashArray.length);
    for(
      int index = 0,
        length = dashArray.length;
      index < length;
      index++
      )
    {baseDashArray.set(index,new PdfReal(dashArray[index]));}
    operands.set(0,baseDashArray);
    // 2. Dash phase.
    ((PdfNumber<?>)operands.get(1)).setValue(value.getDashPhase());
  }
View Full Code Here

    Document context
    )
  {
    super(
      context.getFile(),
      new PdfArray()
      );
  }
View Full Code Here

          PdfDictionary fieldDictionary = (PdfDictionary)fieldReference.getDataObject();
          PdfTextString fieldName = (PdfTextString)fieldDictionary.get(PdfName.T);
          if(fieldName != null && fieldName.getValue().equals(partialName))
          {
            valueFieldReference = fieldReference;
            PdfArray kidFieldObjects = (PdfArray)fieldDictionary.resolve(PdfName.Kids);
            fieldObjectsIterator = (kidFieldObjects == null ? null : kidFieldObjects.iterator());
            break;
          }
        }
        if(valueFieldReference == null)
          break;
View Full Code Here

  {
    Field field = get(key);
    if(field == null)
      return null;

    PdfArray fieldObjects;
    {
      PdfReference fieldParentReference = (PdfReference)field.getBaseDataObject().get(PdfName.Parent);
      if(fieldParentReference == null)
      {fieldObjects = getBaseDataObject();}
      else
      {fieldObjects = (PdfArray)((PdfDictionary)fieldParentReference.getDataObject()).resolve(PdfName.Kids);}
    }
    return (fieldObjects.remove(field.getBaseObject()) ? field : null);
  }
View Full Code Here

    )
  {
    /*
      NOTE: 'D' entry may be undefined.
    */
    PdfArray dashObject = (PdfArray)getBaseDataObject().get(PdfName.D);
    if(dashObject == null)
      return DefaultLineDash;

    float[] dashArray = new float[dashObject.size()];
    for(
      int dashIndex = 0,
        dashLength = dashArray.length;
      dashIndex < dashLength;
      dashIndex++
      )
    {dashArray[dashIndex] = ((PdfNumber<?>)dashObject.get(dashIndex)).getNumberValue();}

    return new LineDash(dashArray);
  }
View Full Code Here

    )
  {
    for(PdfDirectObject fieldObject : fieldObjects)
    {
      PdfReference fieldReference = (PdfReference)fieldObject;
      PdfArray kidReferences = (PdfArray)File.resolve(
        ((PdfDictionary)fieldReference.getDataObject()).get(PdfName.Kids)
        );
      PdfDictionary kidObject;
      if(kidReferences == null)
      {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)))
View Full Code Here

  {
    if(value == null)
    {getBaseDataObject().remove(PdfName.D);}
    else
    {
      PdfArray dashObject = new PdfArray();

      float[] dashArray = value.getDashArray();
      for(
        int dashIndex = 0,
          dashLength = dashArray.length;
        dashIndex < dashLength;
        dashIndex++
        )
      {dashObject.add(new PdfReal(dashArray[dashIndex]));}

      getBaseDataObject().put(PdfName.D, dashObject);
    }
  }
View Full Code Here

    )
  {
    /*
      NOTE: 'Opt' entry may be undefined [PDF:1.6:8.6.3].
    */
    PdfArray items = (PdfArray)File.resolve(getBaseDataObject().get(PdfName.Opt));
    if(items == null)
      return null;

    return new ChoiceItems(
      items,
View Full Code Here

TOP

Related Classes of org.pdfclown.objects.PdfArray

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.