Pregunta

I have a problem with exporting a docx document to html with docx4j. My application cuts paragraphs out from several documents, then concatenates it into a single one, then exports it into html.

The problem is with the lists. The generated docx opens and the content I want is there (although it states that the document have errors and instead of a bullet list, there is a numbered one), but during html export i get the following error message:

ERROR org.docx4j.model.PropertyResolver .getEffectivePPr line 635 - Couldn't find style: ListParagraph

I have listed the known styles and also checked in the StyleTree, and ListParagraph is there.

If I create a new PStyle and assign it to the problematic paragraph, the error is gone, but so is the list format. It becames a simple paragraph without bullets (as it should be). If I try to assign any other style than "Normal", I get the same error, only with other style name in the error message.

if (paragraphProp.getPStyle().getVal().equals("ListParagraph")) {
    listElements.add(paragraph);

Another strange thing is, that I can find paragraphs based on this style, but assigning the same style gets the error...meaning, the "if" above is working, paragraphs are added to the list, but this results in the error mentioned above (I've tried with List Paragraph written seperate, so that is not the problem):

PStyle style = new PStyle();
style.setVal("ListParagraph");
paragraphProp.setPStyle(style);

I also noticed, that there is only Normal and DocDefaults class names for paragraphs in the generated html.

Thank you very much in advance!

¿Fue útil?

Solución

Please try docx4j-nightly-20130828.jar, which incorporates a fix.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top