Package org.apache.fop.pdf

Examples of org.apache.fop.pdf.PDFColor


    /**
     * @see org.apache.fop.pdf.PDFImage#getTransparentColor()
     */
    public PDFColor getTransparentColor() {
        return new PDFColor(fopImage.getTransparentColor().getRed(),
                            fopImage.getTransparentColor().getGreen(),
                            fopImage.getTransparentColor().getBlue());
    }
View Full Code Here


     * Rather than leaving it as the default white.
     * @param col the background colour to fill
     */
    public void setBackgroundColor(Color col) {
        Color c = col;
        PDFColor currentColour = new PDFColor(c.getRed(), c.getGreen(), c.getBlue());
        currentStream.write("q\n");
        currentStream.write(currentColour.getColorSpaceOut(true));

        currentStream.write("0 0 " + width + " " + height + " re\n");

        currentStream.write("f\n");
        currentStream.write("Q\n");
View Full Code Here

     * @param fill true to set the fill color, false for the foreground color
     * @param pdf StringBuffer to write the PDF code to, if null, the code is
     *     written to the current stream.
     */
    protected void setColor(Color col, boolean fill, StringBuffer pdf) {
        PDFColor color = new PDFColor(col);

        closeText();
       
        if (pdf != null) {
            pdf.append(color.getColorSpaceOut(fill));
        } else {
            currentStream.add(color.getColorSpaceOut(fill));
        }
    }
View Full Code Here

            ((IndexColorModel) cm).getGreens(greens);
            ((IndexColorModel) cm).getBlues(blues);
            for (int i = 0; i < ((IndexColorModel) cm).getMapSize(); i++) {
              if ((alphas[i] & 0xFF) == 0) {
                this.m_isTransparent = true;
                this.m_transparentColor = new PDFColor((int) (reds[i] & 0xFF), (int) (greens[i] & 0xFF), (int) (blues[i] & 0xFF));
                break;
              }
            }
          } else {
            // TRANSLUCENT
View Full Code Here

            ((IndexColorModel) cm).getGreens(greens);
            ((IndexColorModel) cm).getBlues(blues);
            for (int i = 0; i < ((IndexColorModel) cm).getMapSize(); i++) {
              if ((alphas[i] & 0xFF) == 0) {
                this.m_isTransparent = true;
                this.m_transparentColor = new PDFColor((int) (reds[i] & 0xFF), (int) (greens[i] & 0xFF), (int) (blues[i] & 0xFF));
                break;
              }
            }
          } else {
            // TRANSLUCENT
View Full Code Here

        return ((ImageRawPNG) this.image).isTransparent();
    }

    /** {@inheritDoc} */
    public PDFColor getTransparentColor() {
        return new PDFColor(((ImageRawPNG) this.image).getTransparentColor());
    }
View Full Code Here

        ColorModel cm = getEffectiveColorModel();
        if (cm instanceof IndexColorModel) {
            IndexColorModel icm = (IndexColorModel)cm;
            if (cm.getTransparency() == IndexColorModel.TRANSLUCENT) {
                int transPixel = icm.getTransparentPixel();
                return new PDFColor(
                        icm.getRed(transPixel),
                        icm.getGreen(transPixel),
                        icm.getBlue(transPixel));
            }
        }
        return new PDFColor(getImage().getTransparentColor());
    }
View Full Code Here

                flushPDFDocument();
            }
            BitmapImage fopimg;
            fopimg = new BitmapImage("TempImage:" + pctx.toString(),
                                     devW, devH, rgb, maskRef);
            fopimg.setTransparent(new PDFColor(255, 255, 255));
            imageInfo = pdfDoc.addImage(resourceContext, fopimg);
            flushPDFDocument();
        }

        currentStream.write("q\n");
View Full Code Here

    /**
     * @see org.apache.fop.pdf.PDFImage#getTransparentColor()
     */
    public PDFColor getTransparentColor() {
        return new PDFColor(fopImage.getTransparentColor().getRed(),
                            fopImage.getTransparentColor().getGreen(),
                            fopImage.getTransparentColor().getBlue());
    }
View Full Code Here

     * @param fill true to set the fill color, false for the foreground color
     * @param pdf StringBuffer to write the PDF code to, if null, the code is
     *     written to the current stream.
     */
    protected void setColor(Color col, boolean fill, StringBuffer pdf) {
        PDFColor color = new PDFColor(col);

        closeText();
       
        if (pdf != null) {
            pdf.append(color.getColorSpaceOut(fill));
        } else {
            currentStream.add(color.getColorSpaceOut(fill));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.pdf.PDFColor

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.