我想在iTextSharp中的pdf 文档中的特定位置使用zapfdingbatslist 打一个复选标记。
到目前为止,我可以做的是我可以显示复选标记,但它都在文档的一侧,而不是在我想要的特定 X、Y 坐标上。我在下面有一个代码,希望能让你明白我在说什么。
String outputFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Test.pdf");
System.IO.FileStream fs;
Document doc = new Document(PageSize.A4, 20, 20, 10, 10);
PdfContentByte cb;
PdfWriter writer;
fs = new System.IO.FileStream(outputFile, System.IO.FileMode.Create);
writer = PdfWriter.GetInstance(doc, fs);
doc.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
writer.AddViewerPreference(PdfName.PICKTRAYBYPDFSIZE, PdfBoolean.PDFTRUE);
doc.Open();
cb = writer.DirectContent;
List myList = new ZapfDingbatsList(52); // Check mark symbol from Dingbatslist
// I have some more code here but it is not needed for the problem
// and thererfore not shown
// I could shohw the dingbatslist check mark here
myList.Add(" ");
doc.Add(myList); // However I want to show it in a specific X, Y position
doc.Close();
writer.Close();
fs.Close();
任何想法?