Hi,
I’m using the new API methods introduced with WORDSNET-11867 to set my custom bullet pictures.
While trying the resulting documents I’ve run into an error when opening the files in Word for Mac:
- Word for Mac 2011: An error is displayed when opening the document telling me it is corrupt and after accepting the warning the bullet pictures aren’t displayed. Instead a clock symbol is displayed where the pictures should be.
- Word for Mac 2016: No error occurs when opening the document but neither bullet pictures nor bullet symbols are displayed at all.
I’ve traced it down to the type attribute not being set on the shape element in numbering.xml inside the docx file. When adding this attribute manually the document opens as expected in both versions of Word for Mac.
This is what the element should look like:
<v:shape id="_x0000_s1025" type="#_x0000_t75" style=“height:0;width:0” o:bullet=“t”>
<v:imagedata r:id=“rId1” o:title=""/>
</v:shape>
And this is what it actually looks like:
<v:shape id="_x0000_s1025" style=“height:0;width:0” o:bullet=“t”>
<v:imagedata r:id=“rId1” o:title=""/>
</v:shape>
It seems the ListLevel.createPictureBullet method calls the Shape constructor with only one argument, resulting in the shape having the type ShapeType.RECTANGLE instead of ShapeType.IMAGE.
Is there any chance of this getting fixed for the next release?
For now I tried working around it by using some really ugly Java reflection hacks to re-implement ListLevel.createPictureBullet with passing ShapeType.IMAGE to the shape constructor.
However this hack causes a NullpointerException when calling com.aspose.words.Document.updateFields so currently I can’t use picture bullets at all. It seems this happens during the width calculation of some element. See the stacktrace below.
Thanks,
Jens
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at com.aspose.words.zzZOH.zzX(Unknown Source)
at com.aspose.words.zzZOH.zzX(Unknown Source)
at com.aspose.words.zzZ0C.zzZ3a(Unknown Source)
at com.aspose.words.zzZ09.getWidth(Unknown Source)
at com.aspose.words.zzZ0D.zzmo(Unknown Source)
at com.aspose.words.zzZ17.getWidth(Unknown Source)
at com.aspose.words.zzZNT.zzZzr(Unknown Source)
at com.aspose.words.zzZNT.zzT(Unknown Source)
at com.aspose.words.zzZNZ.zzU(Unknown Source)
at com.aspose.words.zzZNY.zzS(Unknown Source)
at com.aspose.words.zzZNY.zzX(Unknown Source)
at com.aspose.words.zzWC.zzZ(Unknown Source)
at com.aspose.words.zzZ1N.zzZ5B(Unknown Source)
at com.aspose.words.zzZ1N.zzZ(Unknown Source)
at com.aspose.words.zzXF.zznW(Unknown Source)
at com.aspose.words.zzXF.zzX(Unknown Source)
at com.aspose.words.zzZAT.zzI(Unknown Source)
at com.aspose.words.zzZAT.zzZjr(Unknown Source)
at com.aspose.words.zzZAT.zzR(Unknown Source)
at com.aspose.words.zzZAB.zzw(Unknown Source)
at com.aspose.words.zzYZQ.zzRt(Unknown Source)
at com.aspose.words.zz9S.zzXo(Unknown Source)
at com.aspose.words.zz9T.zzZXS(Unknown Source)
at com.aspose.words.zzZP0.zzZ(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.zz4R.perform(Unknown Source)
at com.aspose.words.zz4S.zzKf(Unknown Source)
at com.aspose.words.zz1W.zzYS(Unknown Source)
at com.aspose.words.zz1W.zzZ(Unknown Source)
at com.aspose.words.zz1W.zz5(Unknown Source)
at com.aspose.words.Range.updateFields(Unknown Source)
at com.aspose.words.Document.updateFields(Unknown Source)
at com.k15t.scroll.words.exporter.DocxExporter.finalProcessing(DocxExporter.java:103)
... 48 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at com.aspose.words.zzZ2B.zzZ(Unknown Source)
at com.aspose.words.zzZOH.zzW(Unknown Source)
at com.aspose.words.zzZOH.zzX(Unknown Source)
... 80 more
Caused by: java.lang.NullPointerException
at com.aspose.words.zzZC.zzY(Unknown Source)
at com.aspose.words.zzZC.zzY(Unknown Source)
at com.aspose.words.zzZC.zzZ(Unknown Source)
at com.aspose.words.zzZ2B.zzW(Unknown Source)
at com.aspose.words.zzZ2B.zzX(Unknown Source)
at com.aspose.words.zzZ2B.zzZ(Unknown Source)
at com.aspose.words.zzZ2B.zzZ(Unknown Source)
... 82 more