Free Support Forum - aspose.com

Error while generating Table Of Contents

Hi,

I tried generating table of contents with the latest version of Aspose.Words for java (with a trial license) and I’m getting an exception while the TOC is generated. I’m attaching the file which is causing the problem, the code and the stack trace

Code:
builder.insertTableOfContents("\o “1-3” \h \z \u");
Document srcDoc = builder.getDocument();
srcDoc.updateFields();

Stack Trace:
java.lang.NullPointerException
at com.aspose.words.fr.b(DocumentSpanConverterInlineStoryTracker.java:65)
at com.aspose.words.fr.a(DocumentSpanConverterInlineStoryTracker.java:38)
at com.aspose.words.fq.eX(DocumentSpanConverter.java:825)
at com.aspose.words.fq.a(DocumentSpanConverter.java:786)
at com.aspose.words.fq.eW(DocumentSpanConverter.java:632)
at com.aspose.words.fq.Ab(DocumentSpanConverter.java:448)
at com.aspose.words.fq.moveNext(DocumentSpanConverter.java:158)
at com.aspose.words.ape.a(SpanField.java:522)
at com.aspose.words.ape.a(SpanField.java:477)
at com.aspose.words.ape.t(SpanField.java:198)
at com.aspose.words.Field.DD(Field.java:464)
at com.aspose.words.Field.a(Field.java:392)
at com.aspose.words.oi.a(FieldUpdater.java:144)
at com.aspose.words.oi.l(FieldUpdater.java:101)
at com.aspose.words.of.execute(FieldUpdateExecutionItem.java:81)
at com.aspose.words.oi.gz(FieldUpdater.java:91)
at com.aspose.words.oi.updateFields(FieldUpdater.java:53)
at com.aspose.words.Range.updateFields(Range.java:157)
at com.aspose.words.Document.updateFields(Document.java:965)
at com.worldcheck.juno.docgen.writers.TableOfContentsWriter.writeToDoc(TableOfContentsWriter.java:37)
at com.worldcheck.juno.docgen.service.DataWriter.run(DataWriter.java:86)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

Hi

Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

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


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