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

Free Support Forum - aspose.com

Doc to html conversion with page break and show page number in footer

sir when i upload html it converted into html as a single html i want the doc file converted into html as number of pages it have in doc file.actually when doc file huge suppose 100 pages when i save then it show as a single html so i want to break every page according same as it have into doc file.how i can achieve this please help me.

i am using following code

if (!new File(serverPath).exists())
    new File(serverPath).mkdirs();

// For uploading the file we require MultiPartRequest
MultipartRequest mp = new MultipartRequest(request, serverPath, 1024 * 1024 * 1024);
// for getting file name
Enumeration <?> itr = mp.getFileNames();
while (itr.hasMoreElements())
    filename = mp.getFilesystemName((String)itr.nextElement());
    System.out.println("filename=" + filename);

Document doc = new Document(serverPath + "\\" + filename);
int pageCoun = doc.getPageCount();
DocumentBuilder builder = new DocumentBuilder(doc);
HtmlSaveOptions options = new HtmlSaveOptions();
// options.setDocumentSplitCriteria(1);
doc.save(serverPath + "\\temp.html", options);


Thanks for your inquiry. There is no concept of pages in simple HTML files. Please try saving to HtmlFixed format instead by using the following code:

Document doc = new Document("D:\\temp\\input.docx");
HtmlFixedSaveOptions opts = new HtmlFixedSaveOptions();
// Specify options as required
doc.save("D:\\temp\\awjava-17.1.0.html", opts);

Hope, this helps.

Best regards,