Is it possible to add a Table with cells to
iTextSharp.text.pdf.PdfContentByte?
Example code I would like to add:
'create a 2 column table
Dim nTbl As Table = New Table(2)
nTbl.BorderWidth = 1
nTbl.BorderColor = New iTextSharp.text.Color(0, 0, 0)
nTbl.Border = iTextSharp.text.Rectangle.TOP_BORDER
nTbl.Padding = 4
nTbl.Spacing = 0
Dim nCell As Cell = New Cell("SPECIFICATIONS")
nCell.Header = True
nCell.BackgroundColor = New iTextSharp.text.Color(153, 153, 153)
nCell.BorderWidth = 1
nCell.Colspan = 2
nTbl.AddCell(nCell)
nCell = New Cell("NAME")
nCell.BackgroundColor = New iTextSharp.text.Color(204, 204, 204)
nCell.BorderWidth = 1
nCell.Colspan = 1
nTbl.AddCell(nCell)
nCell = New Cell("PRODUCT NAME")
nCell.BackgroundColor = New
iTextSharp.text.Color(System.Drawing.Color.White)
nCell.BorderWidth = 1
nCell.Colspan = 1
nTbl.AddCell(nCell)
------------------------------------------------------
Theory of how I think it may be done but now sure:
------------------------------------------------------
Dim stamper As iTextSharp.text.pdf.PdfStamper = Nothing
Dim underContent As iTextSharp.text.pdf.PdfContentByte = Nothing
reader = New iTextSharp.text.pdf.PdfReader(sourceFile)
rect = reader.GetPageSizeWithRotation(1)
stamper = New iTextSharp.text.pdf.PdfStamper(reader, New
System.IO.FileStream(outputFile, IO.FileMode.Create))
underContent = stamper.GetOverContent(1)
underContent.Add(nTbl) ???*****------- This is where I want to add the
table -------********
stamper.Close()
reader.Close()
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/