如何在Itextsharp Pdf Doc中设置短语的绝对位置 [英] How Do I Set Absolute Position Of A Phrase In Itextsharp Pdf Doc
本文介绍了如何在Itextsharp Pdf Doc中设置短语的绝对位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助我使用代码在itextsharp pdfdoc中设置短语的绝对位置。
Kindly assist me with code to set the absolute position of a phrase in itextsharp pdfdoc.
推荐答案
我正在使用C#。谢谢你的关怀。我已经弄清楚它已经解决了。我想为使用itextsharp创建的每个PDF页面添加一个标题。
解决方案是在创建实例后立即打开文档之前插入标题,如下所示:
I am using C#. Thanks for caring. I have figured it out and it's resolved. I wanted to add a header to every PDF page created using itextsharp.
The solution is to insert your header before opening the document soon after creating the instance as shown below:
using (PdfWriter writer = PdfWriter.GetInstance(doc, fs))
{
//now inserting header
writer.PageEvent = new Header();
// end of header
// Step 4: Openning the Document
doc.Open();
.
.
.
.
.
}
这篇关于如何在Itextsharp Pdf Doc中设置短语的绝对位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文