【发布时间】:2014-09-17 03:29:55
【问题描述】:
我需要标题下方居中的“工作设置表”。应该怎么做?
这是我尝试过的:
// Create an empty page
PdfPage page = document.AddPage();
page.Size = PageSize.Letter;
// Get an XGraphics object for drawing
XGraphics gfx = XGraphics.FromPdfPage(page);
//XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode,
PdfFontEmbedding.Always);
// Create a font
XFont HeadingFont = new XFont("Times New Roman", 20, XFontStyle.Bold);
XFont BodyFont = new XFont("Times New Roman", 12);
// Draw the text
gfx.DrawString("Texas Exterior Systems", HeadingFont, XBrushes.Black,
new XRect(0, 0, page.Width, page.Height),
XStringFormats.TopCenter);
gfx.DrawString("Job Setup Sheet", BodyFont, XBrushes.Black,
new XRect(0, 0, page.Width, page.Height),
XStringFormats.Center);
【问题讨论】: