Gets number of links on a specified document page.

@param integer $pageNumber Number of the page.

@return integer
@throws Exception
195989
public function getLinksCount($pageNumber)
    {

        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/links';
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        return count($json->Links->List);
    }
567985
protected function getAdvancedPerPage($pageIndex, &$nextLink, &$lastLink)
    {
        $perPage = $this->countLinks + $pageIndex - 1;

        if( $perPage >= ($getPerPage = $this->getPerPage()) )
        {
            $this->removeLinkFromPagingationBar($nextLink);
            $this->removeLinkFromPagingationBar($lastLink);

            $perPage = $getPerPage;
        }

        return $perPage;
    }
1285228
private function _currentPage(): int
    {
        $currentPage = Craft::$app->getRequest()->getQueryParam($this->pageParam, 1);

        if (is_numeric($currentPage) && $currentPage > $this->totalPages) {
            $currentPage = $this->totalPages > 0 ? $this->totalPages : 1;
        } else if (!is_numeric($currentPage) || $currentPage < 0) {
            $currentPage = 1;
        }

        return (int)$currentPage;
    }
1012528
public int getPageNumber() {
    if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_pageNumber == null)
      jcasType.jcas.throwFeatMissing("pageNumber", "ch.epfl.bbp.uima.types.DataTable");
    return jcasType.ll_cas.ll_getIntValue(addr, ((DataTable_Type)jcasType).casFeatCode_pageNumber);}
558607
public function validateDocument($documentNumber)
    {
        $data = $this->execute(
            self::HTTP_GET,
            self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/validarDocumento',
            ['query' => ['num' => $documentNumber]]
        );

        return $data;
    }
536910
protected function createLink($pageNumber, $meta, $treatAsHref)
    {
        $buildUrl = $this->buildUrlClosure;
        $link     = $this->factory->createLink($buildUrl($pageNumber), $meta, $treatAsHref);

        return $link;
    }
98655
function getPageCount() {
		if (!$this->limit) {
			return 1;
		}
		$rem = ($this->getTotal() % $this->limit);
		$rem = ($rem >= 0) ? $rem : 0;
		$total_pages = ($this->getTotal() - $rem) / $this->limit;
		if ($rem)
			$total_pages++;
		return $total_pages;
	}
453000
public function count(): int
    {
        // If the count is already set, return it
        if(!is_null($this->count)) {
            return $this->count;
        }

        // Maually create a count by looping through the entities. This will
        // trigger the pagination calls to get the correct count of entities
        $count = 0;
        foreach($this as $entity) {
            $count++;
        }

        $this->count = $count;
        return $count;
    }
1056314
public function paginate($count, $size = null, $page = null)
    {
        $this->count = (int)$count;
        $this->size = (int)($size ?: $this->request->get('size', 10));
        $this->page = (int)($page ?: $this->request->get('page', 1));
        $this->pages = (int)ceil($this->count / $this->size);
        $this->prev = ($this->page <= $this->pages && $this->page > 1) ? $this->page - 1 : -1;
        $this->next = $this->page < $this->pages ? $this->page + 1 : -1;

        return $this;
    }
751609
public function getImportedExternalPageLinks($pageNumber)
	{
		$links = [];

		$reader = $this->getPdfReader($this->currentReaderId);
		$parser = $reader->getParser();

		$page = $reader->getPage($pageNumber);
		$page->getPageDictionary();

		$annotations = $page->getAttribute('Annots');
		if ($annotations instanceof PdfIndirectObjectReference) {
			$annotations = PdfType::resolve($parser->getIndirectObject($annotations->value), $parser);
		}

		if ($annotations instanceof PdfArray) {

			$getAttribute = function ($array, $key) {
				if (isset($array[$key]->value)) {
					return $array[$key]->value;
				}

				return '';
			};

			foreach ($annotations->value as $annotation) {
				$annotation = PdfType::resolve($annotation, $parser)->value;

				/* Skip over any annotations that aren't links */
				$type = $getAttribute($annotation, 'Type');
				$subtype = $getAttribute($annotation, 'Subtype');
				if ($type !== 'Annot' || $subtype !== 'Link' || !isset($annotation['A'])) {
					continue;
				}

				/* Calculate the link positioning */
				$position = $getAttribute($annotation, 'Rect');

				if (count($position) !== 4) {
					continue;
				}

				$x1 = $getAttribute($position, 0) / Mpdf::SCALE;
				$y1 = $getAttribute($position, 1) / Mpdf::SCALE;
				$x2 = $getAttribute($position, 2) / Mpdf::SCALE;
				$y2 = $getAttribute($position, 3) / Mpdf::SCALE;
				$width = $x2 - $x1;
				$height = $y2 - $y1;

				$link = $annotation['A'] instanceof PdfIndirectObjectReference ? PdfType::resolve($annotation['A'], $parser)->value : $getAttribute($annotation, 'A');

				if (isset($link['URI'])) {
					$links[] = [
						'x' => $x1,
						'y' => $y1,
						'width' => $width,
						'height' => $height,
						'url' => $getAttribute($link, 'URI')
					];
				}
			}
		}

		return $links;
	}
263264
public function getCountForNextPage($iPage, $iCount)
    {
        if ($iCount < 1) {
            return 0;
        }

        $iPage = (int) trim($iPage);

        //Check page value
        if ($iPage < 1) {
            $iPage = 1;
        }

        //Get max page value
        $iMaxPage = $this->getMaxPage($iCount);
        if ($iMaxPage <= $iPage) {
            return 0;
        }

        $iNextCount = $iCount - $this->iElementOnPage * $iPage;
        if ($iNextCount > $this->iElementOnPage) {
            $iNextCount = $this->iElementOnPage;
        }

        return $iNextCount;
    }
1307453
public function getPages(Paginator $paginator, $pageRange = null)
    {
        $pageRange  = $paginator->getPageRange();
        $pageNumber = $paginator->getCurrentPageNumber();

        $delta = $pageNumber % $pageRange;

        if ($delta == 0) {
            $delta = $pageRange;
        }

        $offset     = $pageNumber - $delta;
        $lowerBound = $offset + 1;
        $upperBound = $offset + $pageRange;

        return $paginator->getPagesInRange($lowerBound, $upperBound);
    }
936461
public function getLink($pageNumber, $linkIndex)
    {

        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/links/' . $linkIndex;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        return $json->Link;
    }
759740
public static function page( int $page , int $count , int $pagesize = 10) :array
    {

//        if(empty($count)){
//            throw new \Exception('Tools page throw : count must is integer and greater than 0!');
//        }
        if( empty($page) || !is_numeric($page) ){
            $page = 1;
        }

        if( empty($pagesize) || !is_numeric($pagesize)){
            $pagesize = 10;
        }

        $maxpage = ceil($count / $pagesize);//获取最大页数

        $limit = [($page - 1) * $pagesize,$pagesize];

        return [
            'page' => $page,
            'pagesize' => $pagesize,
            'count' => $count,
            'maxpage' => $maxpage,
            'limit' => $limit
        ];
    }
1346099
function ezWhatPageNumber( $pageNum, $i = 0 )
    {
        // given a particular generic page number (ie, document numbered sequentially from beginning),
        // return the page number under a particular page numbering scheme ($i)
        $num = 0;
        $start = 1;
        $startNum = 1;
        if ( !isset( $this->ez['pageNumbering'] ) )
        {
            $this->addMessage( 'WARNING: page numbering called for and wasn\'t started with ezStartPageNumbers' );
            return 0;
        }
        foreach ( $this->ez['pageNumbering'][$i] as $k => $v )
        {
            if ( $k <= $pageNum )
            {
                if ( is_array( $v ) )
                {
                    // start block
                    if ( strlen( $v['num'] ) )
                    {
                        // a start was specified
                        $start = $v['num'];
                        $startNum = $k;
                        $num = $pageNum - $startNum + $start;
                    }
                }
                else
                {
                    // stop block
                    $num = 0;
                }
            }
        }
        return $num;
    }
44733
protected function getNumberOfPages()
    {
        $numberOfPages = \ceil($this->totalCount / $this->itemsPerPage);

        if ($this->maximumNumberOfLinks > $numberOfPages) {
            return $numberOfPages;
        }
        return $numberOfPages;
    }
1223679
public function getPages(Paginator $paginator, $pageRange = null)
    {
        $pageRange  = $paginator->getPageRange();
        $pageNumber = $paginator->getCurrentPageNumber();

        $originalPageRange = $pageRange;
        $pageRange         = $pageRange * 2 - 1;

        if ($originalPageRange + $pageNumber - 1 < $pageRange) {
            $pageRange = $originalPageRange + $pageNumber - 1;
        } elseif ($originalPageRange + $pageNumber - 1 > count($paginator)) {
            $pageRange = $originalPageRange + count($paginator) - $pageNumber;
        }

        return parent::getPages($paginator, $pageRange);
    }