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

Free Support Forum - aspose.com

Aspose Word's splitDocument not working

We are using Aspose Word to split document using heading & convert the same in HTML. However, its throwing following error:


java.lang.IllegalStateException

at com.aspose.words.zzZS2.endElement(Unknown Source)

at com.aspose.words.zzZVT.zzZTP(Unknown Source)

at com.aspose.words.zzZVT.zzJ(Unknown Source)

at com.aspose.words.zzZJA.visitParagraphStart(Unknown Source)

at com.aspose.words.Paragraph.zzZ(Unknown Source)

at com.aspose.words.CompositeNode.acceptCore(Unknown Source)

at com.aspose.words.Paragraph.accept(Unknown Source)

at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)

at com.aspose.words.CompositeNode.acceptCore(Unknown Source)

at com.aspose.words.Body.accept(Unknown Source)

at com.aspose.words.zzZVT.zzZA(Unknown Source)

at com.aspose.words.zzZVT.zzZ(Unknown Source)

at com.aspose.words.zzZVT.zzZTS(Unknown Source)

at com.aspose.words.zzZVT.zzZU3(Unknown Source)

at com.aspose.words.zzZRD.zzZ(Unknown Source)

at com.aspose.words.Document.zzZ(Unknown Source)

at com.aspose.words.Document.zzZ(Unknown Source)

at com.aspose.words.Document.save(Unknown Source)

<span lang=“HU” style=“font-size:10.0pt;font-family:Courier;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:“Times New Roman”;
color:red;mso-ansi-language:HU;mso-fareast-language:HU;mso-bidi-language:AR-SA”>
at
routines.com_ge_datacoe_confluence.splitDocument(com_ge_datacoe_confluence.java:610)


PFB code we used:

<span lang=“HU” style=“font-size:10.0pt;font-family:“Courier New”;color:#7F0055;mso-ansi-language:
HU;mso-fareast-language:HU”>public
<span lang=“HU” style=“font-size: 10pt; font-family: “Courier New”;”> <span lang=“HU” style=“font-size:10.0pt;font-family:“Courier New”;
color:#7F0055;mso-ansi-language:HU;mso-fareast-language:HU”>static
<span lang=“HU” style=“font-size: 10pt; font-family: “Courier New”;”> <span lang=“HU” style=“font-size:10.0pt;font-family:“Courier New”;color:#7F0055;mso-ansi-language:
HU;mso-fareast-language:HU”>void
<span lang=“HU” style=“font-size: 10pt; font-family: “Courier New”;”> splitDocument(String
documentLoc, String fileName, String outputLoc) <span lang=“HU” style=“font-size:10.0pt;font-family:“Courier New”;color:#7F0055;mso-ansi-language:
HU;mso-fareast-language:HU”>throws
<span lang=“HU” style=“font-size: 10pt; font-family: “Courier New”;”> Exception {<span lang=“HU” style=“font-size:10.0pt;font-family:“Courier New”;
mso-ansi-language:HU;mso-fareast-language:HU”><o:p></o:p>

log.warn("Loading document from " +documentLoc+ " with name: " + fileName);

//System.out.println("Loading document from " +documentLoc+ "....");

Document doc = new Document(documentLoc);

//In case draft mode, accept all revisions & update document

doc.acceptAllRevisions();

log.warn("Loaded succesfully document from " +documentLoc+ " with name: " + fileName);

HtmlSaveOptions options = new HtmlSaveOptions();

options.setDocumentSplitCriteria(DocumentSplitCriteria.HEADING_PARAGRAPH);

options.setDocumentSplitHeadingLevel(1);

options.setExportHeadersFootersMode(ExportHeadersFootersMode.NONE);

log.warn("Saving document to " +outputLoc+ " with name: " + fileName);

doc.save(outputLoc + "/" + fileName + ".html", options);

log.warn("Saved successfully document to " +outputLoc+ " with name: " + fileName);

}

Looks like this is an issue in API.

Thanks & Regards,

Karunesh. S

Hi there,

Thanks for your inquiry. Could you please attach your input Word document here for testing? We will investigate the issue on our side and provide you more information.

Updated the request with an attachment issue doc.

Hi there,

Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14995. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-14995) have been fixed in this Aspose.Words for .NET 17.6 update and this Aspose.Words for Java 17.6 update.


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