Last post Sep 28, 2011 07:48 AM by AdamGB
Sep 07, 2011 08:39 AM|AdamGB|LINK
Hopefully someone can prevent me from pulling out the remainder of my hair!!!!
I am using the below code to generate the table and add it to a PDF document, that part works fine.
Dim stringWrite As New System.IO.StringWriter()
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)
Using sReader As TextReader = New StringReader(stringWrite.ToString())
Dim list As List(Of IElement) = HTMLWorker.ParseToList(sReader, Nothing)
For Each elm As IElement In list
So as you'll see from this, it simply pulls the HTML from Table1 and adds it to the document. My problem is that it doesn't take into account any table widths that I've set in the HTML. My last column of the table needs to be considerably larger than the rest.
I have set that column to 500px in HTML, but it seems to simply ignore that :-(
Can someone shed some light on this?
Sep 07, 2011 08:56 AM|AdamGB|LINK
Please note that when I say I have edited the width in HTML, I've done this via cell1.Width = Unit.Pixel(300) and the likes and when writing the string out (which displays the HTML) it does show it successfully setting the width. It's just the PDF which
doesn't seem to like it very much.
Sep 28, 2011 07:48 AM|AdamGB|LINK
I got this working by scrapping the whole read HTML table thing. And instead manually adding each row to 'doc'.