Package com.lowagie.text.pdf

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 Rectangle around the page
        cb.setLineWidth(1);
        cb.rectangle(30, 30, document.getPageSize().width() - 60, document.getPageSize().height() - 60);
        cb.stroke();
        cb.restoreState();
View Full Code Here


  /* (non-Javadoc)
   * @see com.lowagie.text.pdf.PdfPageEventHelper#onStartPage(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document)
   */
  public void onStartPage(PdfWriter writer, Document document) {
    PdfContentByte cb = writer.getDirectContentUnder();
    cb.saveState();

    float x;
    float y;
   
    if (centerHorizontally) {
View Full Code Here

        }

        String t = "<?xml version='1.0' encoding='ISO-8859-1'"
                   + " standalone='no'?>" + s1.toString();
        PdfContentByte cb = writer.getDirectContent();
        cb.saveState();
        cb.concatCTM(1.0f, 0, 0, 1.0f, 36, 0);
        float width = document.getPageSize().getWidth() - 20;
        float height = document.getPageSize().getHeight() - 20;
        Graphics2D g2 = cb.createGraphics(width, height);
        //g2.rotate(Math.toRadians(-90), 100, 100);
View Full Code Here

     
      // widths of the different cells of the first row
        float widths[] = width[0];
       
        PdfContentByte cb = canvases[LwgPdfPTable.TEXTCANVAS];
        cb.saveState();
      // border for the complete table
        cb.setLineWidth(2);
        cb.setRGBColorStroke(255, 0, 0);
        cb.rectangle(widths[0], heights[heights.length - 1], widths[widths.length - 1] - widths[0], heights[0] - heights[heights.length - 1]);
        cb.stroke();
View Full Code Here

            cb.stroke();
        }
        cb.restoreState();
       
        cb = canvases[LwgPdfPTable.BASECANVAS];
        cb.saveState();
        // border for the cells
        cb.setLineWidth(.5f);
        // loop over the rows
        for (int line = 0; line < heights.length - 1; ++line) {
          // loop over the columns
View Full Code Here

     
      // widths of the different cells of the first row
        float widths[] = width[0];
       
        PdfContentByte cb = canvases[LwgPdfPTable.TEXTCANVAS];
        cb.saveState();
      // border for the complete table
        cb.setLineWidth(2);
        cb.setRGBColorStroke(255, 0, 0);
        cb.rectangle(widths[0], heights[heights.length - 1], widths[widths.length - 1] - widths[0], heights[0] - heights[heights.length - 1]);
        cb.stroke();
View Full Code Here

            cb.stroke();
        }
        cb.restoreState();
       
        cb = canvases[LwgPdfPTable.BASECANVAS];
        cb.saveState();
        // border for the cells
        cb.setLineWidth(.5f);
        // loop over the rows
        for (int line = 0; line < heights.length - 1; ++line) {
            widths = width[line];
View Full Code Here

           
            document.open();
            PdfContentByte cb = writer.getDirectContent();
           
            // Create the graphics as shapes
            cb.saveState();
            Graphics2D g2 = cb.createGraphicsShapes(500, 500);
            // Print the table to the graphics
            Shape oldClip = g2.getClip();
            g2.clipRect(0, 0, 500, 500);
            table.print(g2);
View Full Code Here

            cb.restoreState();
           
            document.newPage();
           
            // Create the graphics with pdf fonts
            cb.saveState();
            g2 = cb.createGraphics(500, 500);
           
            // Print the table to the graphics
            oldClip = g2.getClip();
            g2.clipRect(0, 0, 500, 500);
View Full Code Here

            }
            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().height() - 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.