Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfArray


    List<? extends PdfDirectObject> components
    )
  {
    super(
      null,//TODO:colorspace?
      new PdfArray(components)
      );
  }
View Full Code Here


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

    PdfArray dataObject = (PdfArray)File.resolve(baseObject);
    PdfDirectObject pageObject = dataObject.get(0);
    if(pageObject instanceof PdfReference)
      return new LocalDestination(baseObject,container,name);
    else if(pageObject instanceof PdfInteger)
      return new RemoteDestination(baseObject,container,name);
    else
View Full Code Here

    Float[] viewParams
    )
  {
    super(
      context.getFile(),
      new PdfArray()
      );

    PdfArray destinationObject = getBaseDataObject();

    destinationObject.add(pageObject);

    switch(mode)
    {
      case Fit:
        destinationObject.add(PdfName.Fit);
        break;
      case FitBoundingBox:
        destinationObject.add(PdfName.FitB);
        break;
      case FitBoundingBoxHorizontal:
        destinationObject.add(PdfName.FitBH);
        destinationObject.add(PdfReal.get(viewParams[0]));
        break;
      case FitBoundingBoxVertical:
        destinationObject.add(PdfName.FitBV);
        destinationObject.add(PdfReal.get(viewParams[0]));
        break;
      case FitHorizontal:
        destinationObject.add(PdfName.FitH);
        destinationObject.add(PdfReal.get(viewParams[0]));
        break;
      case FitRectangle:
        destinationObject.add(PdfName.FitR);
        destinationObject.add(PdfReal.get(viewParams[0]));
        destinationObject.add(PdfReal.get(viewParams[1]));
        destinationObject.add(PdfReal.get(viewParams[2]));
        destinationObject.add(PdfReal.get(viewParams[3]));
        break;
      case FitVertical:
        destinationObject.add(PdfName.FitV);
        destinationObject.add(PdfReal.get(viewParams[0]));
        break;
      case XYZ:
        destinationObject.add(PdfName.XYZ);
        destinationObject.add(PdfReal.get(viewParams[0]));
        destinationObject.add(PdfReal.get(viewParams[1]));
        destinationObject.add(PdfReal.get(viewParams[2]));
        break;
    }
  }
View Full Code Here

  public List<Integer> getSampleCounts(
    )
  {
    ArrayList<Integer> sampleCounts = new ArrayList<Integer>();
    {
      PdfArray sampleCountsObject = (PdfArray)getDictionary().get(PdfName.Size);
      for(PdfDirectObject sampleCountObject : sampleCountsObject)
      {sampleCounts.add(((PdfInteger)sampleCountObject).getRawValue());}
    }
    return sampleCounts;
  }
View Full Code Here

    Gets the tristimulus value, in the CIE 1931 XYZ space, of the diffuse black point.
  */
  public float[] getBlackPoint(
    )
  {
    PdfArray blackPointObject = (PdfArray)getDictionary().get(PdfName.BlackPoint);
    return (blackPointObject == null
      ? new float[]
        {
          0,
          0,
          0
        }
      : new float[]
        {
          ((PdfNumber<?>)blackPointObject.get(0)).getNumberValue(),
          ((PdfNumber<?>)blackPointObject.get(1)).getNumberValue(),
          ((PdfNumber<?>)blackPointObject.get(2)).getNumberValue()
        });
  }
View Full Code Here

    Gets the tristimulus value, in the CIE 1931 XYZ space, of the diffuse white point.
  */
  public float[] getWhitePoint(
    )
  {
    PdfArray whitePointObject = (PdfArray)getDictionary().get(PdfName.WhitePoint);
    return new float[]
      {
        ((PdfNumber<?>)whitePointObject.get(0)).getNumberValue(),
        ((PdfNumber<?>)whitePointObject.get(1)).getNumberValue(),
        ((PdfNumber<?>)whitePointObject.get(2)).getNumberValue()
      };
  }
View Full Code Here

  public List<float[]> getBoundOutputValues(
    )
  {
    List<float[]> outputBounds;
    {
      PdfArray lowOutputBoundsObject = (PdfArray)getDictionary().get(PdfName.C0);
      PdfArray highOutputBoundsObject = (PdfArray)getDictionary().get(PdfName.C1);
      if(lowOutputBoundsObject == null)
      {outputBounds = Arrays.asList(new float[]{0,1});}
      else
      {
        outputBounds = new ArrayList<float[]>();
        Iterator<PdfDirectObject> lowOutputBoundsObjectIterator = lowOutputBoundsObject.iterator();
        Iterator<PdfDirectObject> highOutputBoundsObjectIterator = highOutputBoundsObject.iterator();
        while(lowOutputBoundsObjectIterator.hasNext()
          && highOutputBoundsObjectIterator.hasNext())
        {
          outputBounds.add(
            new float[]
View Full Code Here

    List<? extends PdfDirectObject> components
    )
  {
    super(
      DeviceGrayColorSpace.Default,
      new PdfArray(components)
      );
  }
View Full Code Here

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

    return new LineObject(calloutLineObject,getContainer());
  }
View Full Code Here

  public List<String> getComponentNames(
    )
  {
    List<String> componentNames = new ArrayList<String>();
    {
      PdfArray namesObject = (PdfArray)getBaseDataObject().get(1);
      for(PdfDirectObject nameObject : namesObject)
      {componentNames.add((String)((PdfName)nameObject).getValue());}
    }
    return componentNames;
  }
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.