pdf = "my.pdf" import re rxcountpages = re.compile(r"/Type\s*/Page([^s]|$)", re.MULTILINE|re.DOTALL) def countPages(filename): data = file(filename,"rb").read() return len(rxcountpages.findall(data)) if __name__=="__main__": print "Number of pages in PDF File:", countPages(pdf)
pdfDoc = arcpy.mapping.PDFDocumentOpen(path) print pdfDoc.pageCount
Los miembros que hayan iniciado sesión pueden publicar, seguir las novedades y mucho más. ¿Eres nuevo? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.