Examples of PDFColor


Examples of org.apache.fop.pdf.PDFColor

      int  irx = (int)(rx * cfact);
      int  iry = (int)(ry * cfact);
      int  isw = (int)(sw * cfact);
      int  longwidth = 0;
      int  pass = 0;
      PDFColor thecolor = null;

      do
      {
        if ( pass == 0 && fc != null )
        {
          thecolor = fc;
        }
        else if ( pass == 1 && sc != null )
        {
          int  iswdiv2 = isw / 2;
          thecolor = sc;
          ix -= iswdiv2;
          iy -= iswdiv2;
          irx += iswdiv2;
          iry += iswdiv2;
          iw += isw;
          ih += isw;
          longwidth = (int)(isw * 1.414);
        }
        else
          thecolor = null;


        if ( thecolor != null )
        {
          int    tx = 0;
          int    ty = iry;
          long  a = irx;
          long  b = iry;
          long  Asquared = (long)Math.pow(a, 2);
          long  TwoAsquared = 2 * Asquared;
          long  Bsquared = (long)Math.pow(b, 2);
          long  TwoBsquared = 2 * Bsquared;
          long  d = Bsquared - Asquared * b + Asquared / 4;
          long  dx = 0;
          long  dy = TwoAsquared * b;
          int    rectlen = iw - 2 * irx;
          Vector  bottomlines = new Vector();

          int x0 = tx;

          // Set Transparency modes and select shading.
          currentStream.add("\033*v0n1O\033*c" + (int)(100 - ((0.3f * thecolor.red() + 0.59f * thecolor.green() + 0.11f * thecolor.blue()) * 100f)) + "G\033*v2T");
          // Move to starting position.
          currentStream.add("\033*p" + ix + "x" + iy + "Y");
          // Start raster graphics
          currentStream.add("\033*t300R\033*r" + iw + "s1A\033*b1M");

 
View Full Code Here

Examples of org.jpedal.color.PdfColor

                    break;

                case DynamicVectorRenderer.STROKEDSHAPE:
                    gs=new GraphicsState();
                    gs.setFillType(GraphicsState.STROKE);
                    gs.setStrokeColor(new PdfColor(colors[i].getRed(),colors[i].getGreen(),colors[i].getBlue()));
                    drawShape( (Shape)obj[i],gs, Cmd.S);

                    break;

                case DynamicVectorRenderer.FILLEDSHAPE:
                    gs=new GraphicsState();
                    gs.setFillType(GraphicsState.FILL);
                    gs.setNonstrokeColor(new PdfColor(colors[i].getRed(),colors[i].getGreen(),colors[i].getBlue()));
                    drawShape( (Shape)obj[i],gs, Cmd.F);

                    break;

                case DynamicVectorRenderer.CUSTOM:
                    drawCustom(obj[i]);

                    break;

                case DynamicVectorRenderer.IMAGE:
                    ImageObject imgObj=(ImageObject)obj[i];
                    gs=new GraphicsState();

                    gs.CTM=new float[][]{ {imgObj.image.getWidth(),0,1}, {0,imgObj.image.getHeight(),1}, {0,0,0}};

                    gs.x=imgObj.x;
                    gs.y=imgObj.y;

                    drawImage(this.pageNumber,imgObj.image, gs,false,"extImg"+i, PDFImageProcessing.NOTHING, -1);

                    break;

                case DynamicVectorRenderer.STRING:
                    TextObject textObj=(TextObject)obj[i];
                    gs=new GraphicsState();
                    float fontSize=textObj.font.getSize();
                    double[] afValues={fontSize,0f,0f,fontSize,0f,0f};
                    drawAffine(afValues);

                    drawTR(GraphicsState.FILL);
                    gs.setTextRenderType(GraphicsState.FILL);
                    gs.setNonstrokeColor(new PdfColor(colors[i].getRed(),colors[i].getGreen(),colors[i].getBlue()));
                    drawText(null,textObj.text,gs,textObj.x,-textObj.y,textObj.font); //note y is negative

                    break;

                case 0:
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.