[reportlab-users] How to create multiple SimpleIndex in the same document?

Billy Saelim saelim at email.unc.edu
Thu Jul 8 16:47:24 EDT 2010


Hi,

I wonder how to include more than one SimpleIndex in the same document.
Suppose in my code I have:

doc_structure.append(Paragraph('IndexA', style['Heading3']))
index_a = SimpleIndex(dot=' . ', name='index_a')
doc_structure.append(index_a)

doc_structure.append(Paragraph('IndexB', style['Heading3']))
index_b = SimpleIndex(dot=' . ', name='index_b')
doc_structure.append(index_b)


And I use the name attribute to indicate to which index an item should
go, for example:

doc_structure.append(Paragraph('<b><index name="index_a"
item="myterm" />My Term</b>', style['Heading5']))


And suppose I have created an instance of BaseDocTemplate called doc and
would like to call its multiBuild method, what should I specify for the
canvasmaker parameter? If I do this:

doc.multiBuild(list(doc_structure),
canvasmaker=index_a.getCanvasMaker())

It would throw an AttributeError.

Please let me know what I have done incorrectly and if there is any
example for creating multiple SimpleIndex in a document.

Thanks.

Billy


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100708/60fde91f/attachment.htm>


More information about the reportlab-users mailing list