Examples of PdfGState


Examples of com.lowagie.text.pdf.PdfGState

            BaseFont bf = BaseFont.createFont("Helvetica", BaseFont.WINANSI,
                                              false);
            PdfReader reader = new PdfReader(((File) getValue("srcfile"))
                                             .getAbsolutePath());
            int pagecount = reader.getNumberOfPages();
            PdfGState gs1 = new PdfGState();
            gs1.setFillOpacity(opacity);
            String text = (String) getValue("watermark");
            PdfStamper stamp = new PdfStamper(reader, new FileOutputStream(
                    (File) getValue("destfile")));
            float txtwidth = bf.getWidthPoint(text, fontsize);
            for (int i = 1; i <= pagecount; i++) {
View Full Code Here

Examples of com.lowagie.text.pdf.PdfGState

                    document.add(img);

                    BaseFont bf = BaseFont.createFont("Helvetica",
                            BaseFont.WINANSI,
                            false);
                    PdfGState gs1 = new PdfGState();
                    gs1.setBlendMode(PdfGState.BM_OVERLAY);
                    PdfContentByte cb = writer.getDirectContent();
                    cb.saveState();
                    cb.setGState(gs1);
                    cb.beginText();
                    cb.setFontAndSize(bf, 40);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfGState

     
      Set _pages = doc.getPages();
        for (int i=1;i<=len;i++) {
          if(_pages!=null && !_pages.contains(Integer.valueOf(i))) continue;
          PdfContentByte cb =foreground? stamp.getOverContent(i):stamp.getUnderContent(i);
          PdfGState gs1 = new PdfGState();
          //print.out("op:"+opacity);
          gs1.setFillOpacity(opacity);
          //gs1.setStrokeOpacity(opacity);
            cb.setGState(gs1);
          cb.addImage(img);
        }
        if(bookmarks!=null)stamp.setOutlines(master);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfGState

     
      Set _pages = doc.getPages();
        for (int i=1;i<=len;i++) {
          if(_pages!=null && !_pages.contains(Integer.valueOf(i))) continue;
          PdfContentByte cb =foreground? stamp.getOverContent(i):stamp.getUnderContent(i);
          PdfGState gs1 = new PdfGState();
            gs1.setFillOpacity(0);
            cb.setGState(gs1);
          cb.addImage(img);
        }
        if(bookmarks!=null)stamp.setOutlines(master);
        stamp.close();
View Full Code Here

Examples of com.lowagie.text.pdf.PdfGState

      document.open();

      // step 4: we grab the ContentByte and do some stuff with it
      PdfContentByte cb = writer.getDirectContent();

            PdfGState gs = new PdfGState();
            gs.setFillOpacity(0.5f);
            cb.setGState(gs);
      cb.setColorFill(Color.red);
      cb.circle(260.0f, 500.0f, 250.0f);
      cb.fill();
      cb.circle(260.0f, 500.0f, 200.0f);
      cb.fill();
      cb.circle(260.0f, 500.0f, 150.0f);
      cb.fill();
      gs.setFillOpacity(0.2f);
      cb.setGState(gs);
      cb.setColorFill(Color.blue);
      cb.circle(260.0f, 500.0f, 100.0f);
      cb.fill();
      cb.circle(260.0f, 500.0f, 50.0f);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfGState

            table.getDefaultCell().setBorderWidth(0);
            table.addCell(p);
            table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            table.addCell(new Phrase(new Chunk(headerImage, 0, 0)));
            // initialization of the Graphic State
            gstate = new PdfGState();
            gstate.setFillOpacity(0.3f);
            gstate.setStrokeOpacity(0.3f);
            // initialization of the template
            tpl = writer.getDirectContent().createTemplate(100, 100);
            tpl.setBoundingBox(new Rectangle(-20, -20, 100, 100));
View Full Code Here

Examples of com.lowagie.text.pdf.PdfGState

            pictureBackdrop(gap, 500 - 200 - gap, cb);
            pictureBackdrop(200 + 2 * gap, 500 - 200 - gap, cb);
           
            pictureCircles(gap, 500, cb);
            cb.saveState();
            PdfGState gs1 = new PdfGState();
            gs1.setFillOpacity(0.5f);
            cb.setGState(gs1);
            pictureCircles(200 + 2 * gap, 500, cb);
            cb.restoreState();

            PdfTemplate tp = cb.createTemplate(200, 200);
            cb.saveState();
            pictureCircles(0, 0, tp);
            PdfTransparencyGroup group = new PdfTransparencyGroup();
            tp.setGroup(group);
            tp.sanityCheck();
            cb.setGState(gs1);
            cb.addTemplate(tp, gap, 500 - 200 - gap);
            cb.restoreState();

            tp = cb.createTemplate(200, 200);
            cb.saveState();
            PdfGState gs2 = new PdfGState();
            gs2.setFillOpacity(0.5f);
            gs2.setBlendMode(PdfGState.BM_SOFTLIGHT);
            tp.setGState(gs2);
            tp.sanityCheck();
            pictureCircles(0, 0, tp);
            tp.setGroup(group);
            cb.addTemplate(tp, 200 + 2 * gap, 500 - 200 - gap);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfGState

     * @param y
     * @param cb
     * @throws Exception
     */
    public static void pictureCircles(float x, float y, PdfContentByte cb) throws Exception {
      PdfGState gs = new PdfGState();
      gs.setBlendMode(PdfGState.BM_SOFTLIGHT);
      gs.setFillOpacity(0.7f);
      cb.setGState(gs);
        cb.setColorFill(Color.gray);
        cb.circle(x + 70, y + 70, 50);
        cb.fill();
        cb.circle(x + 100, y + 130, 50);
View Full Code Here

Examples of org.apache.fop.pdf.PDFGState

        if (c.getAlpha() != 255) {
            checkTransparencyAllowed();
            Map vals = new java.util.HashMap();
            vals.put(PDFGState.GSTATE_ALPHA_STROKE,
                    new Float(c.getAlpha() / 255f));
            PDFGState gstate = pdfDoc.getFactory().makeGState(
                    vals, graphicsState.getGState());
            resourceContext.addGState(gstate);
            currentStream.write("/" + gstate.getName() + " gs\n");
        }

        c = getColor();
        if (graphicsState.setColor(c)) {
            applyColor(c, false);
View Full Code Here

Examples of org.apache.fop.pdf.PDFGState

        if (salpha != 255) {
            checkTransparencyAllowed();
            Map vals = new java.util.HashMap();
            vals.put(PDFGState.GSTATE_ALPHA_NONSTROKE, new Float(salpha / 255f));
            PDFGState gstate = pdfDoc.getFactory().makeGState(
                    vals, graphicsState.getGState());
            resourceContext.addGState(gstate);
            currentStream.write("/" + gstate.getName() + " gs\n");
        }

        Map kerning = null;
        boolean kerningAvailable = false;
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.