def get_bbox_header(lbrt, rotated=False):
 (l, b, r, t) = lbrt
 if rotated:
  rotate = (u'%.2f %.2f  translate\n90 rotate' % ((l + r), 0))
 else:
  rotate = u''
 bbox_info = (u'%%%%BoundingBox: %d %d %d %d' % (l, b, np.ceil(r), np.ceil(t)))
 hires_bbox_info = (u'%%%%HiResBoundingBox: %.6f %.6f %.6f %.6f' % (l, b, r, t))
 return (u'\n'.join([bbox_info, hires_bbox_info]), rotate)

def get_bbox_header ( lbrt , rotated = False ) : ( l , b , r , t ) = lbrt if rotated : rotate = ( u'%.2f %.2f  translate\n90 rotate' % ( ( l + r ) , 0 ) ) else : rotate = u'' bbox_info = ( u'%%%%BoundingBox: %d %d %d %d' % ( l , b , np . ceil ( r ) , np . ceil ( t ) ) ) hires_bbox_info = ( u'%%%%HiResBoundingBox: %.6f %.6f %.6f %.6f' % ( l , b , r , t ) ) return ( u'\n' . join ( [ bbox_info , hires_bbox_info ] ) , rotate )
return a postscript header stringfor the given bbox lbrt= .