pdfDoc = arcpy.mapping.PDFDocumentOpen(path) print pdfDoc.pageCount
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)
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.