count property

int get count

Gets the total number of the pages.

Implementation

int get count {
  if (PdfDocumentHelper.getHelper(_helper.document!).isLoadedDocument) {
    int tempCount = 0;
    final IPdfPrimitive? obj = PdfDocumentHelper.getHelper(_helper.document!)
        .catalog[PdfDictionaryProperties.pages];
    final PdfDictionary? node =
        PdfCrossTable.dereference(obj) as PdfDictionary?;
    if (node != null) {
      tempCount = _getNodeCount(node);
    }
    return tempCount;
  } else {
    if (_helper._section == null) {
      return _countPages();
    } else {
      return PdfSectionHelper.getHelper(_helper._section!).count;
    }
  }
}