How to get pdf or pptx document page count

i can get word document page count by api: editor.GetDocument().GetPageCount()。API document:official api document: ONLYOFFICE

but if i call GetPageCount api in pdf or ppt page, it will will throw an error。how can i get ppt and pdf page count by office api?

Hello @isNaN

The method GetPageCount that you referring to is related to the document editor. For presentation editor you can use GetSlidesCount, but there is no such method available for PDF editor.

Thank you for your reply. If the PDF editor does not provide an API to get the number of pages in the file, is there an indirect way to achieve this? Getting the number of pages in a document is a common requirement, and many functionalities depend on this data.

I’ll take a look on alternative ways. Please await for my feedback.