Okay, answered my own question (sorry, I'm new to iText - I just downloaded
it today).
Because you can tell the type of each element you parse, then you can set
the spacing under a paragraph by simply using SpacingAfter:
//--
ArrayList elementList = HTMLWorker
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
Pauli Borodulin wrote:
> Is there any reason why not replace the call
>
> currentParagraph = FactoryProperties.createParagraph(h);
>
> in the above p tag processing with
>
> currentParagraph = FactoryProperties.createParagraph(cprops);
I changed the code in the SVN repository so tha
Pauli Borodulin wrote:
> Is there any reason why not replace the call
>
> currentParagraph = FactoryProperties.createParagraph(h);
>
> in the above p tag processing with
>
> currentParagraph = FactoryProperties.createParagraph(cprops);
The major difference I see, is that createParag
Harakiri wrote:
> [...]
> i showed you how you can by default add a new line - this is exactly
> what browsers do
If I read it correctly, the example showed how to add a new line in the
beginning of every paragraph. Based on my knowledge on web browsers, the
margin/spacing should be after each
--- On Mon, 4/6/09, Pauli Borodulin wrote:
> From: Pauli Borodulin
> Subject: Re: [iText-questions] HTMLWorker: Stylesheet not affecting p elements
> To: harakiri...@yahoo.com, "Post all your questions about iText here"
>
> Date: Monday, April 6, 2009, 12:31 PM
Hi!
Harakiri wrote:
> Change the code of HTMLWorker - its not implemented correctly (depending on
> your viewpoint =) - simply change the above code to
> [...]
> // create newline for P
> currentParagraph.add(factoryProperties.createChunk("\n",
> cprops));
> [...]
--- On Sun, 4/5/09, Pauli Borodulin wrote:
> From: Pauli Borodulin
>
> Since iText's HTMLWorker doesn't add any margin
> after p elements while
> web browsers by default do, I tried adding some using
> StyleSheet object:
> HTMLWorker.startElement(String,
> HashMap) has the following proce
Heya!
Since iText's HTMLWorker doesn't add any margin after p elements while
web browsers by default do, I tried adding some using StyleSheet object:
HTMLWorker hWorker = new HTMLWorker(doc);
StyleSheet styles = new StyleSheet();
styles.loadTagStyle("p", "after", "10");