Examples of saveState()


Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

            pictureBackdrop(200 + 2 * gap, 500, cb);
            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();
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

            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);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

            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();
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

    /**
     * @see com.lowagie.text.pdf.PdfPageEventHelper#onEndPage(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document)
     */
    public void onEndPage(PdfWriter writer, LwgDocument document) {
        PdfContentByte cb = writer.getDirectContent();
        cb.saveState();
        // write the headertable
        table.setTotalWidth(document.right() - document.left());
        table.writeSelectedRows(0, -1, document.left(), document.getPageSize().getHeight() - 50, cb);
        // compose the footer
        String text = "Page " + writer.getPageNumber() + " of ";
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

            cb.setTextMatrix(document.right() - textSize - adjust, textBase);
            cb.showText(text);
            cb.endText();
            cb.addTemplate(tpl, document.right() - adjust, textBase);
        }
        cb.saveState();
        // draw a LwgRectangle around the page
        cb.setColorStroke(Color.orange);
        cb.setLineWidth(2);
        cb.rectangle(20, 20, document.getPageSize().getWidth() - 40, document.getPageSize().getHeight() - 40);
        cb.stroke();
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

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

      cb.circle(260.0f, 500.0f, 250.0f);
      cb.fill();
      cb.saveState();
      cb.setColorFill(Color.red);
      cb.circle(260.0f, 500.0f, 200.0f);
      cb.fill();
      cb.saveState();
      cb.setColorFill(Color.blue);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

      cb.fill();
      cb.saveState();
      cb.setColorFill(Color.red);
      cb.circle(260.0f, 500.0f, 200.0f);
      cb.fill();
      cb.saveState();
      cb.setColorFill(Color.blue);
      cb.circle(260.0f, 500.0f, 150.0f);
      cb.fill();
      cb.restoreState();
      cb.circle(260.0f, 500.0f, 100.0f);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

  }
 
  public void writeTextAt(float x, float y, String text, Font font) {
   
      PdfContentByte cb = pdfWriter.getDirectContent();
      cb.saveState();
      cb.setFontAndSize(font.getBaseFont(), font.getSize());
      cb.beginText();
      cb.setTextMatrix(x , y);
      cb.showText(text);
      cb.endText();
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

    String textPageOfPage = String.format(pageOfPage, writer.getPageNumber());   
    float textBase = 18;
    float textSize = helv.getWidthPoint(textPageOfPage, fontSize);
    float adjust = helv.getWidthPoint("0", fontSize);
    cb.addTemplate(total, document.right() - adjust, textBase);
    cb.saveState();
    cb.beginText();
    cb.setFontAndSize(helv, fontSize);

    cb.setTextMatrix(document.right() - textSize - adjust*2 , textBase);
    cb.showText(textPageOfPage);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.saveState()

            }
            catch (IOException e)
            {
            }
            PdfContentByte cb = writer.getDirectContent();
            cb.saveState();
            // write the headertable
            table.setTotalWidth(document.right() - document.left());
            table.writeSelectedRows(0, -1, document.left(), document.getPageSize().getHeight() - 50, cb);
            // compose the footer
            String text = "Page " + writer.getPageNumber();
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.