Esempio n. 1
0
 public RtfDocument(PaperSize paper, PaperOrientation orientation, CultureInfo cultureInfo)
 {
     _paper       = paper;
     _orientation = orientation;
     _margins     = new Margins();
     if (_orientation == PaperOrientation.Portrait)
     {
         _margins[Direction.Top]    = DefaultValue.MarginSmall;
         _margins[Direction.Right]  = DefaultValue.MarginLarge;
         _margins[Direction.Bottom] = DefaultValue.MarginSmall;
         _margins[Direction.Left]   = DefaultValue.MarginLarge;
     }
     else     // landscape
     {
         _margins[Direction.Top]    = DefaultValue.MarginLarge;
         _margins[Direction.Right]  = DefaultValue.MarginSmall;
         _margins[Direction.Bottom] = DefaultValue.MarginLarge;
         _margins[Direction.Left]   = DefaultValue.MarginSmall;
     }
     _lcid            = (Lcid)cultureInfo.LCID;
     ReadingDirection = cultureInfo.TextInfo.IsRightToLeft
         ? ReadingDirection.RightToLeft
         : ReadingDirection.LeftToRight;
     _fontTable = new List <string>();
     _fontTable.Add(DefaultValue.Font);          // default font
     _colorTable = new List <RtfColor>();
     _colorTable.Add(new RtfColor());            // default color
     _header = null;
     _footer = null;
 }
Esempio n. 2
0
 public RtfDocument(PaperSize paper, PaperOrientation orientation, Lcid lcid)
 {
     _paper       = paper;
     _orientation = orientation;
     _margins     = new Margins();
     if (_orientation == PaperOrientation.Portrait)
     {
         _margins[Direction.Top]    = DefaultValue.MarginSmall;
         _margins[Direction.Right]  = DefaultValue.MarginLarge;
         _margins[Direction.Bottom] = DefaultValue.MarginSmall;
         _margins[Direction.Left]   = DefaultValue.MarginLarge;
     }
     else     // landscape
     {
         _margins[Direction.Top]    = DefaultValue.MarginLarge;
         _margins[Direction.Right]  = DefaultValue.MarginSmall;
         _margins[Direction.Bottom] = DefaultValue.MarginLarge;
         _margins[Direction.Left]   = DefaultValue.MarginSmall;
     }
     _lcid      = lcid;
     _fontTable = new List <string>();
     _fontTable.Add(DefaultValue.Font);          // default font
     _colorTable = new List <RtfColor>();
     _colorTable.Add(new RtfColor());            // default color
     _header = null;
     _footer = null;
 }