Anybody got experience with Aspose Words?


  • kills Dumbledore

    I'm reimplementing a document management library we use but don't want to continue paying for, and using Aspose.Words to translate the WordML xml templates we have into PDFs.

    There's a part of the process where I need to insert some text that's stored as raw WordML.

    Inserting the text directly does what you'd expect and keeps all the formatting tags visible, as Aspose abstracts the XML structure away. It has an InsertHTML method, which I thought I might be able to use, as the maarkup mostly looks like HTML, but it isn't and barfs on invalid HTML.

    The problematic part is nested lists. WordML doesn't use <ol><ol><li>some text</li></ol><li>outer list</li></ol>... type nesting, it seems to have a different tag for each nesting level and no list outer elements, so there's markup like <li></li><l2>some text</l2>

    I'm hoping there's some way within Aspose to insert raw markup and have it deal with it but my searching isn't throwing up much right now. If not, the only approaches I can think of are to parse the raw markup myself to either convert it into HTML or add the list objects manually within Aspose. Both seem rather nasty, especially since I'm working with fragments and not well formed full XML documents.

    Anyone an expert in the API and can point me in the right direction? Or am I missing an easier way to do this?


  • And then the murders began.

    @Jaloopa The docs seem to say that what you want to do should be supported (although it's possible that loading a complete HTML document & InsertHtml() use different parsers).

    Are you using the current version of Aspose.Words?


  • kills Dumbledore

    @Unperverted-Vixen said in Anybody got experience with Aspose Words?:

    Are you using the current version of Aspose.Words?

    No. We have to keep compatibility with the pre 2007 version of the xml markup and Aspose only support features from the current version of Word, so that limits us to a 10 year old version.

    @Unperverted-Vixen said in Anybody got experience with Aspose Words?:

    The docs seem to say that what you want to do should be supported

    That's for HTML import, which looks like it would work but the WordML isn't valid HTML, so I'd need to try and parse the markup and convert it before going down that route


  • kills Dumbledore

    Almost managed it by adding the WordML boilerplate around the outside to make it a full document, then reading that as a new document and inserting the nodes. Except the lists are still screwed and don't seem to match the spec.

    New plan is to update the database where the WordML is stored to make it HTML and just import it straight in


Log in to reply