public ReportPDFCreator(Model.ClientReportVM objModel, string Filename, System.Windows.Controls.Grid visualObj, Grid Recomend, Grid Dun, Grid Legend, double Totalport, bool openR) { DpfName = Filename; Hat = new HatPrint(); Pcp = new PageContentPrint(); this.open = openR; _clientdetails = new string[] { "Order : " + objModel.Order, "Name : " + objModel.FIO, "Date of Birth : " + objModel.DateofBirth, "Personal Consultant Number : " + objModel.Adviser, "Status : " + objModel.Status, }; _clientsummary = objModel.AllocationCollection; this.CurrentP = visualObj; this.RecomendPort = Recomend; this.Dynamic = Dun; this.Legend = Legend; this.Totalport = Totalport; ActivesClasses = objModel.DiagrammValueCollection; }
public void RectangleTextPrint(PdfContentByte cb, BaseFont basefont, string text, System.Windows.Media.Brush color, int posX, int posY, int width = 5, int height = 10) { HatPrint Hat = new HatPrint(); byte r = 0; byte g = 0; byte b = 0; //var solid = (SolidColorBrush)color; // тоже самое только новым синтаксисом => //if (color is SolidColorBrush solid) //{ // r = solid.Color.R; // g = solid.Color.G; // b = solid.Color.B; //} var rect = new iTextSharp.text.Rectangle(posX, posY, posX + width, posY + height) { Border = iTextSharp.text.Rectangle.LEFT_BORDER | iTextSharp.text.Rectangle.RIGHT_BORDER, BorderWidth = 5, BorderColor = new BaseColor(r, g, b), }; cb.Rectangle(rect); Hat.DetailsPrint(cb, basefont, text, posX + 15, posY + 2, 10); }