def split_multicell(self, text, element_name):
pdf = self.pdf<EOL>element = [element for element in self.elements<EOL>if element['<STR_LIT:name>'].lower() == element_name.lower()][<NUM_LIT:0>]<EOL>style = "<STR_LIT>"<EOL>if element['<STR_LIT>']: style += "<STR_LIT:B>"<EOL>if element['<STR_LIT>']: style += "<STR_LIT:I>"<EOL>if element['<STR_LIT>']: style += "<STR_LIT>"<EOL>pdf.set_font(element['<STR_LIT>'],style,element['<STR_LIT:size>'])<EOL>align = {'<STR_LIT:L>':'<STR_LIT:L>','<STR_LIT:R>':'<STR_LIT:R>','<STR_LIT:I>':'<STR_LIT:L>','<STR_LIT:D>':'<STR_LIT:R>','<STR_LIT:C>':'<STR_LIT:C>','<STR_LIT>':'<STR_LIT>'}.get(element['<STR_LIT>']) <EOL>if isinstance(text, unicode) and not PY3K:<EOL><INDENT>text = text.encode("<STR_LIT>","<STR_LIT:ignore>")<EOL><DEDENT>else:<EOL><INDENT>text = str(text)<EOL><DEDENT>return pdf.multi_cell(w=element['<STR_LIT>']-element['<STR_LIT>'],<EOL>h=element['<STR_LIT>']-element['<STR_LIT>'],<EOL>txt=text,align=align,split_only=True)<EOL>
Divide (\n) a string using a given element width