예제 #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;
 }