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

Free Support Forum - aspose.com

Duplicated html content after converting

Hi there


I am using Aspose Word 16.6.0 and classes on github to convert Word files to html files.

There is a problem is that I got another duplicated html pages from converting a Word file with only one page.

Here is my code:
Document doc = new Document(“custom/input/docx/word20160725_2.docx”);
Document pageDoc;
LayoutCollector layoutCollector;
DocumentPageSplitter splitter;
System.out.println(doc.getPageCount());

layoutCollector = new LayoutCollector(doc);
doc.updatePageLayout();
splitter = new DocumentPageSplitter(layoutCollector);

HtmlSaveOptions saveOp = new HtmlSaveOptions();
saveOp.setExportTextInputFormFieldAsText(false);
saveOp.setExportTocPageNumbers(true);
saveOp.setExportPageSetup(true);
saveOp.setExportDocumentProperties(true);
saveOp.setExportRelativeFontSize(false);

for(int p = 1; p<=doc.getPageCount();p++){
pageDoc = splitter.GetDocumentOfPage§;
pageDoc.save(“custom/input/docx/20160725_2.docx.”+p+".html", saveOp);
}


Please check this, thanks :slight_smile:
And Is there any way to fix this?


Hi Craig,

Thanks for your inquiry.

Please embed the fonts inside your input document and share it here for testing. We will investigate the issue on our side and provide you more information. To embed a TrueType font in a saved document in Microsoft Office Word 2013, follow these steps:

  • First, select the File option from the Word ribbon at the top of the screen.
  • From the options bar on the left-hand side, choose Options.
  • A Word Options window will come up. Select the Save option from the banner on the left-hand side.
  • Under Preserve fidelity when sharing this document select the check box next to Embed fonts in the file. Then click OK.

Hi

File updated in this post, thanks :slight_smile:

Hi Craig,

Thanks for sharing the document. We have tested the scenario using latest version of Aspose.Words for Java 16.6.0 and have not found the shared issue. We have attached the output document with this post for your kind reference. Please make sure that you are using the latest version of Aspose.Words for Java 16.6.0 and using the shared document.

Hi Tahir Manzoor


I have reuploaded a file which may cause this problem, please try again, thanks :slight_smile:
Hi Craig,

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-13963. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@craig.w.su,

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