Пример #1
0
        private void DrawDiplomaToPage(PdfPage page, Diploma diploma)
        {
            var start = new XPoint(0, 270);
            var size  = new XPoint(page.Width, page.Height);

            using (var xgr = XGraphics.FromPdfPage(page))
            {
                // if (!string.IsNullOrEmpty(diploma.TemplatePath))
                // {
                // var img = XImage.FromFile(path + diploma.TemplatePath);
                // xgr.DrawImage(img, 0, 0, page.Width, page.Height);
                // }

                DrawName(xgr, diploma.Name, Fonts[30], start, size, XStringFormats.Center);
                start.Y += 105;

                if (!string.IsNullOrEmpty(diploma.Type))
                {
                    DrawText(xgr, diploma.Type, Fonts[23], start, size, XStringFormats.Center);
                }

                start.Y += 30;

                if (!string.IsNullOrEmpty(diploma.Institution))
                {
                    DrawText(xgr, diploma.Institution, Fonts[23], start, size, XStringFormats.Center);
                    start.Y += 30;
                }

                if (!string.IsNullOrEmpty(diploma.City))
                {
                    DrawText(xgr, diploma.City, Fonts[23], start, size, XStringFormats.Center);
                    start.Y += 30;
                }

                if (!string.IsNullOrEmpty(diploma.Text))
                {
                    DrawText(xgr, diploma.Text, Fonts[30], start, size, XStringFormats.Center);
                }
            }
        }
Пример #2
0
 private bool Equals(Diploma other)
 {
     return(string.Equals(Name, other.Name) && string.Equals(City, other.City));
 }