private static void CrateBack(XUnit pageWdith, XUnit pageHeight, PdfDocument document, string currentCardType) { PdfPage page = document.AddPage(); page.Width = new XUnit(pageWdith.Millimeter, XGraphicsUnit.Millimeter); page.Height = new XUnit(pageHeight.Millimeter, XGraphicsUnit.Millimeter); XGraphics gfx = XGraphics.FromPdfPage(page); // HACK² gfx.MUH = PdfFontEncoding.Unicode; //gfx.MFEH = PdfFontEmbedding.Default; gfx.ScaleAtTransform(-1, 1, page.Width / 2, page.Height / 2); XFont font = new XFont("Verdana", 13, XFontStyle.Regular); var costSize = new XSize(new XUnit(23, XGraphicsUnit.Millimeter), font.Height); var costMarginRight = new XUnit(5, XGraphicsUnit.Millimeter); var actionRect = new XRect(costMarginRight, new XUnit(5, XGraphicsUnit.Millimeter), pageHeight * 2, costSize.Height * 2); var actionTextRect = actionRect; actionTextRect.Height = costSize.Height; actionTextRect.Offset(new XUnit(3, XGraphicsUnit.Millimeter), 0); gfx.TranslateTransform(new XUnit(3, XGraphicsUnit.Millimeter), 0); gfx.RotateAtTransform(90, actionRect.TopLeft); gfx.DrawRoundedRectangle(XPens.MidnightBlue, XBrushes.DarkSlateBlue, actionRect, new XSize(10, 10)); gfx.ScaleAtTransform(1, -1, actionTextRect.Center); gfx.DrawString(currentCardType, font, XBrushes.White, actionTextRect, XStringFormats.TopLeft); gfx.ScaleAtTransform(1, -1, actionTextRect.Center); gfx.RotateAtTransform(-90, actionRect.TopLeft); gfx.TranslateTransform(new XUnit(-3, XGraphicsUnit.Millimeter), 0); var circle = new XRect(new XUnit(-3, XGraphicsUnit.Millimeter), pageHeight - new XUnit(10, XGraphicsUnit.Millimeter), new XUnit(13, XGraphicsUnit.Millimeter), new XUnit(13, XGraphicsUnit.Millimeter)); gfx.DrawEllipse(XPens.MidnightBlue, XBrushes.White, circle); }