Docx4j: Bold table cells in pdf

219 Views Asked by At

I try to make text in a table cell bold. This works great for a .docx document. When converting it to pdf the bold style is removed.

Any suggestions?

Here the code which I use to make the text bold:

        P paragraph;
        String openXML = "<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">"
          + "<w:pPr>"
          + "<w:rPr>"
          + "<w:b/>"
          + "</w:rPr>"
          + "</w:pPr>"
          + "<w:r>"
          + "<w:rPr>"
          + "<w:b/>"
          + "</w:rPr>"
          + "<w:t>" + content + "</w:t>"
          + "</w:r>"
          + "</w:p>";

        paragraph = (P) XmlUtils.unmarshalString(openXML);
        tableCell.getContent().add(paragraph);
0

There are 0 best solutions below