Hello, I am getting the following output (attaching screenshot Output received.png (66.9 KB)
for your reference)
- The first image is taking the Heading Properties of the list heading.
I want it to be inserted and then, get the next heading followed by the next image.
Required output.png (47.8 KB)
Code:
builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_2);
builder.getListFormat().setList(mainList);
builder.getListFormat().listIndent();
builder.getListFormat().getListLevel().setNumberStyle(NumberStyle.ARABIC);
builder.getListFormat().getListLevel().setNumberFormat("\u0000.\u0001");
fontStyles.SetSubHeading(font); // custom method
builder.writeln("Scenario of Application Flows Diagram");
builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.BODY_TEXT);
builder.getListFormat().setList(null);
fontStyles.SetTextFont(font); // Custom method
// The four lines used below to set properties of inserted image has been included in a method 'insertDiagrams' in a separate class and I am calling it as a reference
Shape shape = builder.insertImage(ImageIO.read(url)); // url is a URL object
shape.setWrapType(WrapType.TOP_BOTTOM);
shape.setWidth(300);
shape.setHeight(300);
builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_2);
builder.getListFormat().setList(mainList);
builder.getListFormat().listIndent();
builder.getListFormat().getListLevel().setNumberStyle(NumberStyle.ARABIC);
builder.getListFormat().getListLevel().setNumberFormat("\u0000.\u0001");
fontStyles.SetSubHeading(font);
builder.writeln("Application Technical Architecture Diagram");
builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.BODY_TEXT);
builder.getListFormat().setList(null);
fontStyles.SetTextFont(font);
// The four lines used below to set properties of inserted image has been included in a method 'insertDiagrams' in a separate class and I am calling it as a reference
Shape shape = builder.insertImage(ImageIO.read(url)); // url is a URL object
shape.setWrapType(WrapType.TOP_BOTTOM);
shape.setWidth(300);
shape.setHeight(300);