Hi Balder,

On Mon, Feb 6, 2012 at 10:21 PM, Balder VC <li...@redlab.be> wrote:
> Hi Keith, I read it like the OP wants a list of IElements. But only gave the
> Java way of doing that.
>
> Here is the C# way
...

> I'll write pseudo code but it is with anonymous inner classes perhaps OP
> gets more confused. I heard that anonymous inner classes don't work in C#.
> ;)

How true :(

> List myelements = new List();
> XMLWorkerHelper.getInstance().parseXHtml(new ElementHandler() {
>       public void add(final Writable w) {
>               if (w instanceof WritableElement) {
>                       List<Element> elements = 
> ((WritableElement)w).elements();
>                       for (Element e : elements) {
>                               myelements.add(e); // in Java the Paragraph 
> extends from java.util.List
> so don't do addAll()
>                       }
>                }
>       }
> }, yourhtmlstringorfileresource);
> // do stuff with your myelements

Not sure about Java users, but a **lot** of .NET users seem to want to
convert HTML to PDF. Even though I mostly do web apps (well used to
anyway) I never understood why. But learning the new XmlWorker API is
on my personal TODO list.

Thanks for the tips - keith

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to