c# - iTextSharp Paragraph Containing a Table not Written to a Column -
in following code, creating pdfptable, adding paragraph. try add paragraph column. doesn't work. never gets added.
if add table directly column, added fine.
what doing wrong?
(fwiw, simplified version of larger project has elements created in manner.)
here code:
private void form3_load(object sender, eventargs e) { string pdffile = string.format("{0}{1}.pdf", path.gettemppath(), guid.newguid()); document pdfdoc = new document(); pdfwriter writer = pdfwriter.getinstance(pdfdoc, new filestream(pdffile, filemode.create)); pdfdoc.open(); pdfcontentbyte pcb = writer.directcontent; columntext columns = new columntext(pcb); pdfptable table = createtable(); paragraph para = new paragraph(); para.add(table); columns.addelement(para); columns.setsimplecolumn(0, 0, 72*8, 72*11); columns.go(); pdfdoc.close(); process.start(pdffile); } private pdfptable createtable() { pdfptable table = new pdfptable(2); table.addcell("bob"); table.addcell("mike"); return table; }
Comments
Post a Comment