参考:http://www.foxtable.com/webhelp/topics/1197.htm
Dim doc As PrintDoc = e.Form.GernatePrintDoc(pg)
'设置页眉
rt = New prt.RenderText '设置文本对象的内容
rt.Text = "第[PageNo]页,共[PageCount]页" '设置文本内容
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Right '靠右对齐
rt.Style.Borders.Bottom = New prt.LineDef(0.3, Color.Green) '设置底边框
rt.Style.Padding.Bottom = 0.5 '底端内容缩进0.5毫米
rt.Style.FontSize = 8 '字体大小为8磅
Doc.PageHeader = rt '作为页眉使用
doc.Preview()