def get_filesize ( self , pdf ) : try : filesize = float ( pdf . get_size ( ) ) return filesize / 1024 except ( POSKeyError , TypeError ) : return 0
file name and number of pages for pdf file using python
Compute the filesize of the PDF
def get_filesize(self, pdf):
        """Compute the filesize of the PDF
        """
        try:
            filesize = float(pdf.get_size())
            return filesize / 1024
        except (POSKeyError, TypeError):
            return 0