问题
Currently I am working Generating Pdf file. My problem is that I want to print my addressTable into absolute position
PdfWriter writer = PdfWriter.GetInstance(doc,stream)
PdfContentByte cb = writer.getDirectContent();
ColumnText ct = new ColumnText(cb);
Phrase myText = new Phrase("TEST paragraph\nNewline");
ct.SetSimpleColumn(myText, 34, 750, 580, 317, 15, Element.ALIGN_LEFT);
ct.Go();
This is my code but getDirectContent() give me error. So please any body help me that how to print my address table into fixed position.
回答1:
That's easy. Go to the C# port of the examples of my book. Take a look at the code samples in Chapter 3. You'll find examples with lines such as:
PdfContentByte over = writer.DirectContent;
This is one of the minor differences between the Java version and the C# version.
来源:https://stackoverflow.com/questions/16932904/how-to-implement-getdirectcontent-itextsharp