Class Writer


  • class Writer
    extends java.lang.Object
    The concrete class which will write a the watermark on the stamp. It is meant to be used through WatermarkerTool or WatermarkerBuilder.
    • Constructor Summary

      Constructors 
      Constructor Description
      Writer​(PdfReader reader, PdfStamper stamp, java.lang.String text, int fontsize, float opacity, java.awt.Color color)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) Writer withFont​(BaseFont font)  
      (package private) void write()
      Does the magic, with all parameters already set and valid.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • text

        private java.lang.String text
      • fontsize

        private int fontsize
      • opacity

        private float opacity
      • color

        private java.awt.Color color
    • Constructor Detail

      • Writer

        Writer​(PdfReader reader,
               PdfStamper stamp,
               java.lang.String text,
               int fontsize,
               float opacity,
               java.awt.Color color)
    • Method Detail

      • write

        void write()
            throws java.io.IOException,
                   DocumentException
        Does the magic, with all parameters already set and valid. At the end, the PDF file configured through the stamp parameter will be written.
        Throws:
        DocumentException - if the default "Helvetica" font cannot be created
        java.io.IOException - if the default "Helvetica" font cannot be created