Пример #1
0
        private void PdfHeader(Document doc, PdfWriter writer)
        {
            string totalStar = string.Empty;

            writer.PageEvent = new HeaderAndFooterEvent();
            string tmp = "这个是标题";

            doc.Add(HeaderAndFooterEvent.InsertTitleContent(tmp));
        }
Пример #2
0
        private void First(Document doc, PdfWriter writer)
        {
            string tmp = "分析报告";

            doc.Add(HeaderAndFooterEvent.InsertTitleContent(tmp));

            tmp = "(正文     页,附件 0 页)";
            doc.Add(HeaderAndFooterEvent.InsertTitleContent(tmp));

            //模版 显示总共页数
            HeaderAndFooterEvent.tpl = writer.DirectContent.CreateTemplate(100, 100); //模版的宽度和高度
            PdfContentByte cb = writer.DirectContent;

            cb.AddTemplate(HeaderAndFooterEvent.tpl, 266, 714);//调节模版显示的位置
        }