我希望把使用我的PDF文檔zapfdingbatslist在iTextSharp的複選標記在特定位置在PDF文檔中的zapfdingbatslist。如何在特定的位置寫使用iTextSharp的
我到目前爲止所能做的是我可以顯示覆選標記,但它全部位於文檔的一側,而不是我想要的特定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();
任何想法?
這就是我在這裏所喜愛的,因此你可以撿到許多聰明的頭腦。有多少人會直接從質量書的作者那裏得到答案?我猜不是太多。謝謝Mr @BrunoLowagie我非常感謝你的正確迴應/解決方案。上帝保佑。 – Edper 2013-05-04 10:29:15
我工作的一部分是回答問題,但在SO上很有趣;-) – 2013-05-04 16:18:42