Пример #1
0
        public void                                opSetNonStrokeColor(PdfColor color)
        {
            if (color is PdfColorRGB rgb)
            {
                if (_curNonStrokeColorSpace != "DeviceRGB")
                {
                    throw new PdfException("Can't set RGB Color, Invalid device colorspace " + _curStrokeColorSpace + " selected.");
                }

                WriteNumber(rgb.Red, 4, true);
                WriteNumber(rgb.Green, 4, true);
                WriteNumber(rgb.Blue, 4, true);
            }
            else
            if (color is PdfColorCMYK cmyk)
            {
                if (_curNonStrokeColorSpace != "DeviceCMYK")
                {
                    throw new PdfException("Can't set CMYK Color, Invalid device colorspace " + _curStrokeColorSpace + " selected.");
                }

                WriteNumber(cmyk.Cyan, 4, true);
                WriteNumber(cmyk.Magenta, 4, true);
                WriteNumber(cmyk.Yellow, 4, true);
                WriteNumber(cmyk.Black, 4, true);
            }

            WriteStr(bs_sc);
            _curNonStrokeColor = color;
        }
Пример #2
0
 public PdfStyleText()
 {
     _locked      = false;
     _font        = null;
     _fontSize    = new PdfDistance(12.0);
     _lineSpacing = 1;
     _textColor   = null;
 }
Пример #3
0
        public PdfStyleFill(PdfColor fillColor)
        {
            if (fillColor is null)
            {
                throw new ArgumentNullException(nameof(fillColor));
            }

            _fillColor = fillColor;
            _locked    = true;
        }
Пример #4
0
        public PdfStyleFill(PdfStyleFill style)
        {
            if (style is null)
            {
                throw new ArgumentNullException(nameof(style));
            }

            _fillColor = style._fillColor;
            _locked    = false;
        }
 public PdfStyleLine()
 {
     _locked     = false;
     _lineColor  = null;
     _lineWidth  = new PdfDistance(1.0);
     _capStyle   = PdfLineCapStyle.Butt;
     _joinStyle  = PdfLineJoinStyle.Bevel;
     _miterLimit = 1.0;
     _dashArray  = null;
     _dashPhase  = new PdfDistance(0);
 }
Пример #6
0
        public PdfStyleText(PdfFont font, PdfDistance size, double lineSpacing, PdfColor textColor)
        {
            if (font is null)
            {
                throw new ArgumentNullException(nameof(font));
            }

            _locked      = true;
            _font        = font;
            _fontSize    = size;
            _lineSpacing = lineSpacing;
            _textColor   = textColor;
        }
Пример #7
0
        public PdfStyleText(PdfFont font, PdfDistance size)
        {
            if (font is null)
            {
                throw new ArgumentNullException(nameof(font));
            }

            _locked      = true;
            _font        = font;
            _fontSize    = size;
            _lineSpacing = 1.1;
            _textColor   = PdfColorCMYK.ncBlack;
        }
Пример #8
0
        public PdfStyleText(PdfStyleText style)
        {
            if (style is null)
            {
                throw new ArgumentNullException(nameof(style));
            }

            _locked      = false;
            _font        = style._font;
            _fontSize    = style._fontSize;
            _lineSpacing = style._lineSpacing;
            _textColor   = style._textColor;
        }
Пример #9
0
 private void                                _init()
 {
     _resources              = new PdfResourceEntryList();
     _dataStream             = new StreamBuffer();
     _curStrokeColorSpace    = null;
     _curNonStrokeColorSpace = null;
     _curStrokeColor         = null;
     _curNonStrokeColor      = null;
     _curLineWidth           = new PdfDistance(-1);
     _curLineCap             = PdfLineCapStyle.Unknown;
     _curLineJoin            = PdfLineJoinStyle.Unknown;
     _curMiterLimit          = -1;
     _curDashArray           = null;
     _curDashPhase           = new PdfDistance(-1);
 }
        public PdfStyleLine(PdfColor lineColor, PdfDistance lineWith, PdfLineCapStyle CapStyle, PdfLineJoinStyle joinStyle, double miterLimit, PdfDistance[] dashArray, PdfDistance dashPhase)
        {
            if (lineColor is null)
            {
                throw new ArgumentNullException(nameof(lineColor));
            }

            _locked     = true;
            _lineColor  = lineColor;
            _lineWidth  = lineWith;
            _capStyle   = CapStyle;
            _joinStyle  = joinStyle;
            _miterLimit = miterLimit;
            _dashArray  = dashArray;
            _dashPhase  = dashPhase;
        }
        public PdfStyleLine(PdfColor lineColor, PdfDistance lineWidth)
        {
            if (lineColor is null)
            {
                throw new ArgumentNullException(nameof(lineColor));
            }

            _locked     = true;
            _lineColor  = lineColor;
            _lineWidth  = lineWidth;
            _capStyle   = PdfLineCapStyle.Butt;
            _joinStyle  = PdfLineJoinStyle.Bevel;
            _miterLimit = 1.0;
            _dashArray  = null;
            _dashPhase  = new PdfDistance(0);
        }
        public PdfStyleLine(PdfStyleLine style)
        {
            if (style is null)
            {
                throw new ArgumentNullException(nameof(style));
            }

            _locked     = false;
            _lineColor  = style._lineColor;
            _lineWidth  = style._lineWidth;
            _capStyle   = style._capStyle;
            _joinStyle  = style._joinStyle;
            _miterLimit = style._miterLimit;
            _dashArray  = style._dashArray;
            _dashPhase  = style._dashPhase;
        }
Пример #13
0
        public void                                opSetStrokeColor(PdfColor color)
        {
            if (color is PdfColorRGB rgb)
            {
                WriteNumber(rgb.Red, 4, true);
                WriteNumber(rgb.Green, 4, true);
                WriteNumber(rgb.Blue, 4, true);
            }
            else
            if (color is PdfColorCMYK cmyk)
            {
                WriteNumber(cmyk.Cyan, 4, true);
                WriteNumber(cmyk.Magenta, 4, true);
                WriteNumber(cmyk.Yellow, 4, true);
                WriteNumber(cmyk.Black, 4, true);
            }

            WriteStr(bs_SC);
            _curStrokeColor = color;
        }
Пример #14
0
 public PdfStyleFill()
 {
     _fillColor = null;
     _locked    = false;
 }