Platinum Partner

Count PDF Pages

Returns the number of pages in a PDF file


import re

def count_pdf_pages(path):
	pattern = re.compile("<<.*?Page.*?>>", re.MULTILINE)
	file = open(path, 'rb')
	content = f.read()
	file .close()
	return len(pattern.findall(content))
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}