@check_page<EOL><INDENT>def cell(self, w,h=<NUM_LIT:0>,txt='<STR_LIT>',border=<NUM_LIT:0>,ln=<NUM_LIT:0>,align='<STR_LIT>',fill=<NUM_LIT:0>,link='<STR_LIT>'):<DEDENT>
txt = self.normalize_text(txt)<EOL>k=self.k<EOL>if(self.y+h>self.page_break_trigger and not self.in_footer and self.accept_page_break()):<EOL><INDENT>x=self.x<EOL>ws=self.ws<EOL>if(ws><NUM_LIT:0>):<EOL><INDENT>self.ws=<NUM_LIT:0><EOL>self._out('<STR_LIT>')<EOL><DEDENT>self.add_page(self.cur_orientation)<EOL>self.x=x<EOL>if(ws><NUM_LIT:0>):<EOL><INDENT>self.ws=ws<EOL>self._out(sprintf('<STR_LIT>',ws*k))<EOL><DEDENT><DEDENT>if(w==<NUM_LIT:0>):<EOL><INDENT>w=self.w-self.r_margin-self.x<EOL><DEDENT>s='<STR_LIT>'<EOL>if(fill==<NUM_LIT:1> or border==<NUM_LIT:1>):<EOL><INDENT>if(fill==<NUM_LIT:1>):<EOL><INDENT>if border==<NUM_LIT:1>:<EOL><INDENT>op='<STR_LIT:B>'<EOL><DEDENT>else:<EOL><INDENT>op='<STR_LIT:f>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>op='<STR_LIT:S>'<EOL><DEDENT>s=sprintf('<STR_LIT>',self.x*k,(self.h-self.y)*k,w*k,-h*k,op)<EOL><DEDENT>if(isinstance(border,basestring)):<EOL><INDENT>x=self.x<EOL>y=self.y<EOL>if('<STR_LIT:L>' in border):<EOL><INDENT>s+=sprintf('<STR_LIT>',x*k,(self.h-y)*k,x*k,(self.h-(y+h))*k)<EOL><DEDENT>if('<STR_LIT:T>' in border):<EOL><INDENT>s+=sprintf('<STR_LIT>',x*k,(self.h-y)*k,(x+w)*k,(self.h-y)*k)<EOL><DEDENT>if('<STR_LIT:R>' in border):<EOL><INDENT>s+=sprintf('<STR_LIT>',(x+w)*k,(self.h-y)*k,(x+w)*k,(self.h-(y+h))*k)<EOL><DEDENT>if('<STR_LIT:B>' in border):<EOL><INDENT>s+=sprintf('<STR_LIT>',x*k,(self.h-(y+h))*k,(x+w)*k,(self.h-(y+h))*k)<EOL><DEDENT><DEDENT>if(txt!='<STR_LIT>'):<EOL><INDENT>if(align=='<STR_LIT:R>'):<EOL><INDENT>dx=w-self.c_margin-self.get_string_width(txt)<EOL><DEDENT>elif(align=='<STR_LIT:C>'):<EOL><INDENT>dx=(w-self.get_string_width(txt))/<NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>dx=self.c_margin<EOL><DEDENT>if(self.color_flag):<EOL><INDENT>s+='<STR_LIT>'+self.text_color+'<STR_LIT:U+0020>'<EOL><DEDENT>if (self.ws and self.unifontsubset):<EOL><INDENT>for uni in UTF8StringToArray(txt):<EOL><INDENT>self.current_font['<STR_LIT>'].append(uni)<EOL><DEDENT>space = self._escape(UTF8ToUTF16BE('<STR_LIT:U+0020>', False))<EOL>s += sprintf('<STR_LIT>',(self.x + dx) * k,(self.h - (self.y + <NUM_LIT:0.5>*h+ <NUM_LIT> * self.font_size)) * k)<EOL>t = txt.split('<STR_LIT:U+0020>')<EOL>numt = len(t)<EOL>for i in range(numt):<EOL><INDENT>tx = t[i]<EOL>tx = '<STR_LIT:(>' + self._escape(UTF8ToUTF16BE(tx, False)) + '<STR_LIT:)>'<EOL>s += sprintf('<STR_LIT>', tx);<EOL>if ((i+<NUM_LIT:1>)<numt):<EOL><INDENT>adj = -(self.ws * self.k) * <NUM_LIT:1000> / self.font_size_pt<EOL>s += sprintf('<STR_LIT>', adj, space)<EOL><DEDENT><DEDENT>s += '<STR_LIT>'<EOL>s += '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>if (self.unifontsubset):<EOL><INDENT>txt2 = self._escape(UTF8ToUTF16BE(txt, False))<EOL>for uni in UTF8StringToArray(txt):<EOL><INDENT>self.current_font['<STR_LIT>'].append(uni)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>txt2 = self._escape(txt)<EOL><DEDENT>s += sprintf('<STR_LIT>',(self.x+dx)*k,(self.h-(self.y+<NUM_LIT>*h+<NUM_LIT>*self.font_size))*k,txt2)<EOL><DEDENT>if(self.underline):<EOL><INDENT>s+='<STR_LIT:U+0020>'+self._dounderline(self.x+dx,self.y+<NUM_LIT>*h+<NUM_LIT>*self.font_size,txt)<EOL><DEDENT>if(self.color_flag):<EOL><INDENT>s+='<STR_LIT>'<EOL><DEDENT>if(link):<EOL><INDENT>self.link(self.x+dx,self.y+<NUM_LIT>*h-<NUM_LIT>*self.font_size,self.get_string_width(txt),self.font_size,link)<EOL><DEDENT><DEDENT>if(s):<EOL><INDENT>self._out(s)<EOL><DEDENT>self.lasth=h<EOL>if(ln><NUM_LIT:0>):<EOL><INDENT>self.y+=h<EOL>if(ln==<NUM_LIT:1>):<EOL><INDENT>self.x=self.l_margin<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.x+=w<EOL><DEDENT>
Output a cell