def _pdfjs_version():
 try:
  (pdfjs_file, file_path) = pdfjs.get_pdfjs_res_and_path('build/pdf.js')
 except pdfjs.PDFJSNotFound:
  return 'no'
 else:
  pdfjs_file = pdfjs_file.decode('utf-8')
  version_re = re.compile("^(PDFJS\\.version|var pdfjsVersion) = '([^']+)';$", re.MULTILINE)
  match = version_re.search(pdfjs_file)
  if (not match):
   pdfjs_version = 'unknown'
  else:
   pdfjs_version = match.group(2)
  if (file_path is None):
   file_path = 'bundled'
  return '{} ({})'.format(pdfjs_version, file_path)

def _pdfjs_version ( ) : try : ( pdfjs_file , file_path ) = pdfjs . get_pdfjs_res_and_path ( 'build/pdf.js' ) except pdfjs . PDFJSNotFound : return 'no' else : pdfjs_file = pdfjs_file . decode ( 'utf-8' ) version_re = re . compile ( "^(PDFJS\\.version|var pdfjsVersion) = '([^']+)';$" , re . MULTILINE ) match = version_re . search ( pdfjs_file ) if ( not match ) : pdfjs_version = 'unknown' else : pdfjs_version = match . group ( 2 ) if ( file_path is None ) : file_path = 'bundled' return '{} ({})' . format ( pdfjs_version , file_path )
get the pdf .