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

Free Support Forum - aspose.com

HTML PageCount

I’m trying to get a page count of all files in a folder. I’ve been successfull at getting ppt, doc, xls, and some html pages. Other html pages that are around 7 pages actually come out to be 227 pagecount in the Document object. I’ve attached the file to see if you can tell me what the problem is or even be a fix in a later version. The original file is an html file, but I had to change the extension to txt in order to attach it to this message.

Another question is in disposing of aspose objects. Are Document, Presentation, and Workbook not disposable? I feel like in doing pagecounts on all these files, I get tons of memory leaks.



Thanks for your request. I managed to reproduce the problem on my side and created new issue #7739 in our defect database. I will notify you as soon as it is fixed.
Best regards.

Ok thank you. Do you happen to know what is actually causing the problem in that file so that we can avoid it. Thanks


Thanks for your request. It seems the problem occurs because there are merged cells in the HTML document (colspan). We will further investigate the issue and provide you more information.
Best regards.

Any word on when this might be fixed? Thanks


Thanks for your inquiry. Unfortunately, the problem is still unresolved. Partially the problem can be resolved using the following code:

// Open HTML
Document doc = new Document(@"Test082\culprit.htm");
// Remove content from merged cells
// Get collection of cells in the docuemnt
NodeCollection cells = doc.GetChildNodes(NodeType.Cell, true);
foreach (Cell cell in cells)
    // Check whether cell is merged with previouse
    if (cell.CellFormat.HorizontalMerge == CellMerge.Previous ||
    cell.CellFormat.VerticalMerge == CellMerge.Previous)
        // Remove content from the cell
// Get page count

However, page count in this case is still not correct.
Best regards.

The issues you have found earlier (filed as 7739) have been fixed in this update.

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