Package com.lowagie.text.pdf

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


            cb.beginText();
            cb.setFontAndSize(helv, 12);
            float adjust = helv.getWidthPoint("0", 12);
            cb.setTextMatrix(document.right() - textSize - adjust, textBase);
            cb.showText(text);
            cb.endText();
            cb.addTemplate(tpl, document.right() - adjust, textBase);
            cb.saveState();
        }
    }
}
View Full Code Here


                cb.showTextAligned(Element.ALIGN_CENTER, (String)getValue("title"), 595f, 262f, 0f);
              }
              if (getValue("side") == null) {
                cb.showTextAligned(Element.ALIGN_CENTER, (String)getValue("title"), 385f, 262f, 270f);
              }
              cb.endText();
            }
            cb.moveTo(370, 0);
            cb.lineTo(370, 525);
            cb.moveTo(410, 525);
            cb.lineTo(410, 0);
View Full Code Here

        seitex.beginText();
        seitex.setFontAndSize(bf, fontsize);
        seitex.setTextMatrix(m1, m2, m3, m4, xoff + recc.width() / 2,
                             yoff + recc.height() / 2);
        seitex.showText(text);
        seitex.endText();
        seitex.restoreState();
      }
      stamp.close();
    }
    catch (Exception e) {
View Full Code Here

        cb.setFontAndSize(headerFont, 10);

        float adjust = headerFont.getWidthPoint("0", 10);
        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);
View Full Code Here

                cb.showTextAligned(LwgElement.ALIGN_CENTER, title, 595f, 262f, 0f);
              }
              if (side == null) {
                cb.showTextAligned(LwgElement.ALIGN_CENTER, title, 385f, 262f, 270f);
              }
              cb.endText();
            }
            cb.moveTo(370, 0);
            cb.lineTo(370, 525);
            cb.moveTo(410, 525);
            cb.lineTo(410, 0);
View Full Code Here

                }
                BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
                cb.beginText();
                cb.setFontAndSize(bf, 14);
                cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "page " + p + " of " + ((n / 2) + (n % 2 > 0? 1 : 0)), width / 2, 40, 0);
                cb.endText();
            }
            // step 5: we close the document
            document.close();
        }
        catch (Exception de) {
View Full Code Here

              over.setFontAndSize(bf, 18);
              over.setTextMatrix(30, 30);
              over.showText("page " + i);
              over.setFontAndSize(bf, 32);
              over.showTextAligned(LwgElement.ALIGN_LEFT, "DUPLICATE", 230, 430, 45);
              over.endText();
            }
            // adding an extra page
            stamp.insertPage(1, LwgPageSize.A4);
            over = stamp.getOverContent(1);
          over.beginText();
View Full Code Here

            stamp.insertPage(1, LwgPageSize.A4);
            over = stamp.getOverContent(1);
          over.beginText();
          over.setFontAndSize(bf, 18);
            over.showTextAligned(LwgElement.ALIGN_LEFT, "DUPLICATE OF AN EXISTING PDF DOCUMENT", 30, 600, 0);
            over.endText();
            // adding a page from another document
            PdfReader reader2 = new PdfReader("SimpleAnnotations1.pdf");
            under = stamp.getUnderContent(1);
            under.addTemplate(stamp.getImportedPage(reader2, 3), 1, 0, 0, 1, 0, 0);
            // closing PdfStamper will generate the new PDF file
View Full Code Here

      PdfContentByte cb = writer.getDirectContent();
      cb.beginText();
      cb.setColorFill(new Color(0x00, 0xFF, 0x00));
      cb.setFontAndSize(bf, 12);
      cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "Grass is green", 250, 700, 0);
      cb.endText();
    } catch (DocumentException de) {
      System.err.println(de.getMessage());
    } catch (IOException ioe) {
      System.err.println(ioe.getMessage());
    }
View Full Code Here

            cb.beginText();
            cb.setFontAndSize(helv, 12);
            float adjust = helv.getWidthPoint("0", 12);
            cb.setTextMatrix(document.right() - textSize - adjust, textBase);
            cb.showText(text);
            cb.endText();
            cb.addTemplate(tpl, document.right() - adjust, textBase);
            cb.saveState();
        }
    }
}
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.