Hello Team.
I am using Aspose.Word to parse word document. I need to extract citation information from EN_CITE ADDIN fields.
Here is my code example:
public int visitFieldStart(FieldStart fieldStart) throws Exception {
Field field = fieldStart.getField();
if (field.getType()==FieldType.FIELD_ADDIN
&& field.getFieldCode().startWith("ADDIN EN.CITE <EndNote>")) {
String xmlText = field.getFieldCode().substring(14);
System.out.println(xmlText);
}
return 0;
}
If a citation is a simple one such as [1], the code works correctly.
But if a citation contains a few references, field.getFieldCode does not contain any xml text.
I have checked the word document and found out that it stores ADDIN information in two ways:
- for simple citation inside w:instrText
- for citation with a few references inside w:fldData encoded by BASE64.
<w:fldChar w:fldCharType=“begin”>
<w:fldData xml:space=“preserve”>PEVuZE5vdGU+PENpdGU+PEF1dGhvcj5MYW50ejwvQXV0aG9yPjxZZWFyPjE5
I was wondering if there is any way to extract this encoded string by Aspose.Word?
Thank you in advance,
Svetlana