Esempio n. 1
0
 def do_heading(self, text, sty):
     # create bookmarkname
     bn = sha1(text.encode('utf-8') + sty.name.encode('utf-8')).hexdigest()
     # modify paragraph text to include an anchor point with name bn
     h = Paragraph(text + '<a name="%s"/>' % bn, sty)
     # store the bookmark name on the flowable so afterFlowable can see this
     h._bookmarkName = bn
     self.story.append(h)
Esempio n. 2
0
 def do_heading(self, text, sty):
     # create bookmarkname
     bn = sha1(text.encode('utf-8') + sty.name.encode('utf-8')).hexdigest()
     # modify paragraph text to include an anchor point with name bn
     h = Paragraph(text + '<a name="%s"/>' % bn, sty)
     # store the bookmark name on the flowable so afterFlowable can see this
     h._bookmarkName = bn
     self.story.append(h)
Esempio n. 3
0
def doHeading(text,sty):
    from hashlib import sha1
    #create bookmarkname
    bn=sha1(text+sty.name).hexdigest()
    #modify paragraph text to include an anchor point with name bn
    h=Paragraph(text+'<a name="%s"/>' % bn,sty)
    #store the bookmark name on the flowable so afterFlowable can see this
    h._bookmarkName=bn
    story.append(h)
Esempio n. 4
0
def doHeading(text, sty):
    from hashlib import sha1
    #create bookmarkname
    bn = sha1((text + sty.name).encode('utf-8')).hexdigest()
    #modify paragraph text to include an anchor point with name bn
    h = Paragraph(text + '<a name="%s"/>' % bn, sty)
    #store the bookmark name on the flowable so afterFlowable can see this
    h._bookmarkName = bn
    story.append(h)
Esempio n. 5
0
 def _do_heading(self, text, sty):
     if isinstance(text, list):
         text = "_".join(text)
     # create bookmarkname
     bn = sha1(text + sty.name).hexdigest()
     # modify paragraph text to include an anchor point with name bn
     h = Paragraph(text + '<a name="%s"/>' % bn, sty)
     # store the bookmark name on the flowable so afterFlowable can see this
     h._bookmarkName = bn
     self.story.append(h)
Esempio n. 6
0
 def _do_heading(self, text, sty):
     if isinstance(text, list):
         text = "_".join(text)
     # create bookmarkname
     bn = sha1(text + sty.name).hexdigest()
     # modify paragraph text to include an anchor point with name bn
     h = Paragraph(text + '<a name="%s"/>' % bn, sty)
     # store the bookmark name on the flowable so afterFlowable can see this
     h._bookmarkName = bn
     self.story.append(h)