def ocr_buttons(r):
 if (not current.deployment_settings.has_module('ocr')):
  return ''
 if r.component:
  urlargs = [r.id, r.component_name]
 else:
  urlargs = []
 f = r.function
 c = r.controller
 a = r.application
 T = current.T
 UPLOAD = T('Upload Scanned OCR Form')
 DOWNLOAD = T('Download OCR-able PDF Form')
 _style = 'height:10px;float:right;padding:3px;'
 output = DIV(A(IMG(_src=('/%s/static/img/upload-ocr.png' % a), _alt=UPLOAD), _id='upload-pdf-btn', _href=URL(c=c, f=f, args=(urlargs + ['import.pdf'])), _title=UPLOAD, _style=_style), A(IMG(_src=('/%s/static/img/download-ocr.png' % a), _alt=DOWNLOAD), _id='download-pdf-btn', _href=URL(c=c, f=f, args=(urlargs + ['create.pdf'])), _title=DOWNLOAD, _style=_style))
 return output

def ocr_buttons ( r ) : if ( not current . deployment_settings . has_module ( 'ocr' ) ) : return '' if r . component : urlargs = [ r . id , r . component_name ] else : urlargs = [ ] f = r . function c = r . controller a = r . application T = current . T UPLOAD = T ( 'Upload Scanned OCR Form' ) DOWNLOAD = T ( 'Download OCR-able PDF Form' ) _style = 'height:10px;float:right;padding:3px;' output = DIV ( A ( IMG ( _src = ( '/%s/static/img/upload-ocr.png' % a ) , _alt = UPLOAD ) , _id = 'upload-pdf-btn' , _href = URL ( c = c , f = f , args = ( urlargs + [ 'import.pdf' ] ) ) , _title = UPLOAD , _style = _style ) , A ( IMG ( _src = ( '/%s/static/img/download-ocr.png' % a ) , _alt = DOWNLOAD ) , _id = 'download-pdf-btn' , _href = URL ( c = c , f = f , args = ( urlargs + [ 'create.pdf' ] ) ) , _title = DOWNLOAD , _style = _style ) ) return output
generate print pdf button in the view .