Hi there.
I tried out the AltChunkHtml.java sample code from the samples dir. It works fine as long as I don't try to convert the result to a pdf by using org.docx4j.convert.out.pdf.PdfConversion.
Here's my code:
public class AltChunkHtml {
public static void main(String[] args) throws Exception {
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
String html = "<html><head><title>Import me</title></head><body><p>Hello World!</p></body></html>";
AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(new PartName("/hw.html"));
afiPart.setBinaryData(html.getBytes());
afiPart.setContentType(new ContentType("text/html"));
Relationship altChunkRel = wordMLPackage.getMainDocumentPart().addTargetPart(afiPart);
// .. the bit in ...