Ejemplo n.º 1
0
        /**
         * Creates a PdfPattern object.
         * @param   painter a pattern painter instance
         * @param   compressionLevel the compressionLevel for the stream
         * @since   2.1.3
         */
        internal PdfPattern(PdfPatternPainter painter, int compressionLevel) : base()
        {
            PdfNumber one    = new PdfNumber(1);
            PdfArray  matrix = painter.Matrix;

            if (matrix != null)
            {
                Put(PdfName.MATRIX, matrix);
            }
            Put(PdfName.TYPE, PdfName.PATTERN);
            Put(PdfName.BBOX, new PdfRectangle(painter.BoundingBox));
            Put(PdfName.RESOURCES, painter.Resources);
            Put(PdfName.TILINGTYPE, one);
            Put(PdfName.PATTERNTYPE, one);
            if (painter.IsStencil())
            {
                Put(PdfName.PAINTTYPE, new PdfNumber(2));
            }
            else
            {
                Put(PdfName.PAINTTYPE, one);
            }
            Put(PdfName.XSTEP, new PdfNumber(painter.XStep));
            Put(PdfName.YSTEP, new PdfNumber(painter.YStep));
            bytes = painter.ToPdf(null);
            Put(PdfName.LENGTH, new PdfNumber(bytes.Length));
            FlateCompress(compressionLevel);
        }
Ejemplo n.º 2
0
 /**
 * Creates a PdfPattern object.
 * @param   painter a pattern painter instance
 * @param   compressionLevel the compressionLevel for the stream
 * @since   2.1.3
 */
 internal PdfPattern(PdfPatternPainter painter, int compressionLevel)
     : base()
 {
     PdfNumber one = new PdfNumber(1);
     PdfArray matrix = painter.Matrix;
     if ( matrix != null ) {
         Put(PdfName.MATRIX, matrix);
     }
     Put(PdfName.TYPE, PdfName.PATTERN);
     Put(PdfName.BBOX, new PdfRectangle(painter.BoundingBox));
     Put(PdfName.RESOURCES, painter.Resources);
     Put(PdfName.TILINGTYPE, one);
     Put(PdfName.PATTERNTYPE, one);
     if (painter.IsStencil())
         Put(PdfName.PAINTTYPE, new PdfNumber(2));
     else
         Put(PdfName.PAINTTYPE, one);
     Put(PdfName.XSTEP, new PdfNumber(painter.XStep));
     Put(PdfName.YSTEP, new PdfNumber(painter.YStep));
     bytes = painter.ToPdf(null);
     Put(PdfName.LENGTH, new PdfNumber(bytes.Length));
     FlateCompress(compressionLevel);
 }
Ejemplo n.º 3
0
 /** Creates a color representing a pattern.
  * @param painter the actual pattern
  */
 public PatternColor(PdfPatternPainter painter) : base(TYPE_PATTERN, .5f, .5f, .5f)
 {
     this.painter = painter;
 }
Ejemplo n.º 4
0
 internal PdfName AddSimplePattern(PdfPatternPainter painter)
 {
     PdfName name = (PdfName)documentPatterns[painter];
     if ( name == null ) {
         name = new PdfName("P" + patternNumber);
         ++patternNumber;
         documentPatterns[painter] = name;
     }
     return name;
 }
Ejemplo n.º 5
0
 /**
 * Creates a PdfPattern object.
 * @param   painter a pattern painter instance
 */
 internal PdfPattern(PdfPatternPainter painter)
     : this(painter, DEFAULT_COMPRESSION)
 {
 }
Ejemplo n.º 6
0
 /** Creates a color representing a pattern.
                            * @param painter the actual pattern
                            */
 public PatternColor(PdfPatternPainter painter)
     : base(TYPE_PATTERN, .5f, .5f, .5f)
 {
     this.painter = painter;
 }
Ejemplo n.º 7
0
 /**
  * Creates a PdfPattern object.
  * @param   painter a pattern painter instance
  */
 internal PdfPattern(PdfPatternPainter painter) : this(painter, DEFAULT_COMPRESSION)
 {
 }
Ejemplo n.º 8
0
 /**
 * @see com.lowagie.text.pdf.PdfContentByte#setPatternStroke(com.lowagie.text.pdf.PdfPatternPainter)
 */
 public override void SetPatternStroke(PdfPatternPainter p)
 {
     CheckNoColor();
     base.SetPatternStroke(p);
 }
Ejemplo n.º 9
0
 /**
 * @see com.lowagie.text.pdf.PdfContentByte#setPatternStroke(com.lowagie.text.pdf.PdfPatternPainter, java.awt.Color, float)
 */
 public override void SetPatternStroke(PdfPatternPainter p, Color color, float tint)
 {
     CheckNoColor();
     base.SetPatternStroke(p, color, tint);
 }
Ejemplo n.º 10
0
 /**
  * @see com.lowagie.text.pdf.PdfContentByte#setPatternStroke(com.lowagie.text.pdf.PdfPatternPainter)
  */
 public override void SetPatternStroke(PdfPatternPainter p)
 {
     CheckNoColor();
     base.SetPatternStroke(p);
 }
Ejemplo n.º 11
0
 /**
  * @see com.lowagie.text.pdf.PdfContentByte#setPatternStroke(com.lowagie.text.pdf.PdfPatternPainter, java.awt.Color, float)
  */
 public override void SetPatternStroke(PdfPatternPainter p, Color color, float tint)
 {
     CheckNoColor();
     base.SetPatternStroke(p, color, tint);
 }