PDF-related

更新时间:
复制 MD 格式

Perform operations on PDF documents, such as retrieving the page number, jumping to a page, and setting the page rendering mode.

Important

This document is no longer maintained. Use the new version of Intelligent Media Management.

Get page numbers and jump to pages

  • Retrieve the total number of pages

     /*
      * @return: number
      */
      let totalPages = await demo.PDFApplication().ActivePDF.PagesCount
  • Retrieve the current page number

     /*
      * @return: number
      */
      let totalPages = await demo.PDFApplication().ActivePDF.CurrentPage
  • Jump to a specific page

     /*
      * @param : { PageNum: number }
      */
      let PageNum = 10
      await demo.PDFApplication().ActivePDF.JumpToPage({PageNum})
  • Current page change event

      function eventHandle() {
        // do something
      }
      // Add a listener for the current page change event.
      demo.PDFApplication().Sub.CurrentPageChange = eventHandle
      // Destroy the event listener.
      demo.PDFApplication().Sub.CurrentPageChange = null

Set the page rendering mode

This feature is supported in V1.1.2 and later versions.

  /*
  * 1: Single-page mode
  * 0: Multi-page mode
  */
  // Set the mode to single-page mode.
  demo.PDFApplication().ActivePDF.PageMode = 1