I have a related question.

If the element is a paragraph (p), then you could use SpacingAfter to create
the desired white space after the paragraph. Something like this:

//--------------------------------------
ArrayList elementList = HTMLWorker.ParseToList(strReader, theStyleSheet);

iTextSharp.text.Paragraph theParagraph;

for (int k = 0; k < elementList.Count; ++k)
{                
    theParagraph = (iTextSharp.text.Paragraph)elementList[k];                   
           
    theParagraph.FirstLineIndent = 22.0F;
    theParagraph.SpacingAfter = 10.0F;
    document.Add(theParagraph);                
}
//--------------------------------------

I tested the example on some html that has only paragraph tags. So I knew
all the elements in the ArrayList were p tags - so I could go ahead and cast
each element in the list to a iTextSharp.text.Paragraph. It works. My
question is this. Normally the more appropriate cast to
iTextSharp.text.IElement is used when looping through the elements returned
by ParseToList(). Is there a way to determine the element type of an element
in the list? If so, a person could do operations on the element (such as my
theParagraph.SpacingAfter above, because I knew I was dealing with a
paragraph).

Dan
-- 
View this message in context: 
http://www.nabble.com/HTMLWorker%3A-Stylesheet-not-affecting-p-elements-tp22896923p23993211.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
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/

Reply via email to