We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

New picture bullet feature not working in Word for Mac 2011

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

Hi Jens,


Thanks for your inquiry.
jensk15t:
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.
Could you please attach your input and output Word documents along with code example here for testing? We will investigate the issue on our side and provide you more information.
jensk15t:
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.
Please create a standalone Java application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

Hi,


I’ve attached both input and output documents. The texts $scroll.title and $scroll.content are replaced during the document processing - in this case with the document title and the list.

This basically is the code snippet that creates the list definition:

ListCollection lists = documentBuilder.getDocument().getLists();
com.aspose.words.List list = lists.add(ListTemplate.BULLET_DIAMONDS);
for (ListLevel listLevel : list.getListLevels()) {
listLevel.createPictureBullet();
listLevel.getImageData().setImage(getResourceAsStream(resourcePath));
}

documentBuilder.getCurrentParagraph().getListFormat().setListLevelNumber(listLevelNumber);
documentBuilder.getCurrentParagraph().getListFormat().setList(list);

Just try opening output.docx with both Microsoft Word for Mac (broken) and Microsoft Word on Windows (works).

The NullPointerException happens with another document. I’ll need some more time to prepare a standalone example and will probably send it after Dec. 27.

Thanks for looking into this,
Jens

Hi Jens,


Thanks for sharing the documents. Yes, Microsoft Word for Mac does not open the shared output document. We suggest you please try the latest version of Aspose.Words for Java 15.12.0 and let us know if you still face problem.

Please share the standalone Java application when it is ready. We will investigate the issue on our side and provide you more information.

Hi Tahir,


I tried creating a file with the 15.12.0 release. Unfortunately the shapeType attribute is still missing and Microsoft Word for Mac displays the same error message as for files created with 15.11.0.

Are there any changes in 15.12.0 that are supposed to affect the list numbering? I haven’t seen anything like that in the changelog.

Thanks,
Jens

Hi Jens,


Thanks for your inquiry. We fixed some issues related to lists in Aspose.Words for Java 15.12.0. However, your issue is related to Word for Mac. Please share the standalone Java application when it is ready. We will then provide you more information about your query.

Hi Tahir,


I’ve attached a new input docx file as well as a standalone java application that adds two picture bullet lists to the document. The picture bullet images are embedded in the java class.

When opening the resulting document in Word for Mac 2011 an error is displayed and after document repair instead of the picture bullets a symbol is being displayed.

When opening the resulting document in Word for Windows the picture bullets are displayed as expected (and no error triggering document repair occurs).

In the resulting file you’ll see that word/numbering.xml doesn’t contain the shape type attributes as described in my first post.

I’ve reproduced this behaviour with versions 15.11.0 as well as 15.12.0

I’ve also attached two screenshots from both Word for Windows and for Mac.

Let me know if you need anything else.

Thanks,
Jens

Hi Jens,


Thanks for sharing the detail. We have tested the scenario and have noticed that output document does not open in Word for Mac 2011. See the attached image for detail. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-12929. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,


I’ve seen that the new version 16.1 does not resolve this issue (at least it’s not mentioned in your changelog).

While I do understand that you might have more pressing bugs to fix and other features to implement, I wanted to clarify that this issue does not only affect Word for Mac 2011 users.

It also causes the bullet list images to not display at all when using the recent Word for Mac 2016.
So I can’t just tell my customers to upgrade to a new Word version.

I’m currently adding the missing XML attribute I mentioned in my first post during a postprocessing step to the Word file I’m generating and this is working well. So while I of course don’t know all the required technical implementation details, I suppose fixing this issue should be rather easy for you.


Cheers,
Jens

Hi Jens,

Thanks for your inquiry.
jensk15t:
I've seen that the new version 16.1 does not resolve this issue (at least it's not mentioned in your changelog).
We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. Our developers work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.
jensk15t:
I wanted to clarify that this issue does not only affect Word for Mac 2011 users.

It also causes the bullet list images to not display at all when using the recent Word for Mac 2016.
So I can't just tell my customers to upgrade to a new Word version.
We have logged this information in our issue tracking system. We will update you via this forum thread once there is any update available on this issue.

Currently, your issue is pending for analysis and is in the queue. Once our product team completes the analysis of your issue, we will then be able to provide you an estimate.

Thanks for your patience and understanding.
Hi Jens,

Thanks for your patience. Could you please check the attached 'fixed.docx' at your side using MS Word 2011 for Mac and let us know if this is your desired output? Thanks for your cooperation.

Hi Tahir,


I can confirm that fixed.docx is displaying as expected in both Word for Mac 2011 and 2016.

Thanks for fixing it!
Jens
Hi Jens,

Thanks for your feedback. We will inform you via this forum thread once this issue is resolved.

The issues you have found earlier (filed as WORDSNET-12929) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.