Hi,
I am using the 13.2.0 version of Aspose Words and I’d like to insert a caption for the images in my document.
The caption is define as follow:
Figure { STYLEREF 1 \s }-{ SEQ Figure * ARABIC \s 1 } figureTitle
The problem is that the SEQ field “\s” option is not taken into account by Aspose.
With MS Word the sequence number is reset after each “Heading 1”, but with Aspose the number is not reset after the “Heading 1”.
So in the final document we have something like that:
Figure 1-1 myFigure
Figure 2-2 myNextFigure
Whereas we expect:
Figure 1-1 myFigure
Figure 2-1 myNextFigure
Hi Roseline,
- Please supply us with the code from your application that is causing the issue
- Please supply us with the input document that is causing the issue
- Please supply us with the output document showing the undesired behavior
- Please supply us with the target document showing the desired behavior. (please create this document using Microsoft Word)
As soon as you get these pieces of information to us we’ll start our investigation into your issue.
Many thanks,
Hi,
Here is the code I use to generate the document:
DocumentBuilder builder = new DocumentBuilder();
Style headingStyle = builder.getDocument().getStyles().getByStyleIdentifier(StyleIdentifier.HEADING_1);
headingStyle.getListFormat().applyNumberDefault();
for (int i = 1; i
builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_1);
builder.writeln("Section " + i);
builder.getParagraphFormat().clearFormatting();
builder.insertImage(“D:\diag.emf”);
builder.writeln();
builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.CAPTION);
builder.write(“Figure “);
Field f = builder.insertField(“STYLEREF " + StyleIdentifier.HEADING_1 + " \s”);
builder.write(”-”);
builder.insertField(“SEQ Figure \* ARABIC \s 1”);
builder.writeln(“diagram”);
}
builder.getParagraphFormat().clearFormatting();
builder.insertImage(“D:\diag.emf”);
builder.writeln();
builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.CAPTION);
builder.write(“Figure “);
Field f = builder.insertField(“STYLEREF " + StyleIdentifier.HEADING_1 + " \s”);
builder.write(”-”);
builder.insertField(“SEQ Figure \* ARABIC \s 1”);
builder.writeln(“diagram”);
builder.getDocument().save(“D:\Test.doc”);
The attached document “Test.doc” is document generated by this code.
“TestExpected.doc” is the expected document, created with word, differences have been highlighted.
The issues you have found earlier (filed as WORDSNET-7909) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.