Reportlab + SimpleDocTemplate + Table - create QR code with text - multiple pages
<p>I'm using Reportlab to create a pdf file that can span across multiple pages with the following format:</p>

<p>QR code + h1 paragraph + 2-3 lines of text</p>

<p>We need to support a dynamic number of elements with the format I described above.</p>

<p>I was thinking of using a Table inside a SimpleDocTemplate but couldn't find a way to support dynamic number of elements than can span over multiple pages.</p>

<p>How would you tackle this challenge?</p>

<p>This snippet is not fully working, but it could help you, for start </p>

<pre><code>class StandardReport:

def __init__(self,):
    self.doc = BaseDocTemplate(destinationPath , showBoundary = 0, leftMargin=0.7*cm, rightMargin=0.7*cm, topMargin=0.7*cm, bottomMargin=0.7*cm, pagesize=A4)
    self.simpleFrame = Frame(self.doc.leftMargin, self.doc.bottomMargin, self.doc.width, self.doc.height - 5*cm, id='normal')

def createPdf(self):
    templates = [];
    self.doc.totalPages = 0;

    self.fill_sample();
    templates.append(SamplePageTempalte(self));
    self.doc.totalPages = self.doc.totalPages + 1;

    self.doc.addPageTemplates(templates);
    self.doc.build(self.Elements)

class SamplePageTempalte (PageTemplate):
    def __init__ (self, context):
        self.context = context
        self.largeur = self.context.doc.pagesize[0]
        self.hauteur = self.context.doc.pagesize[1]
        self.simpleFrame = Frame( self.context.doc.leftMargin, self.context.doc.bottomMargin, self.context.doc.width, self.context.doc.height - 3*cm, id='normal')
        PageTemplate.__init__ (self, id="GraphStatPageTemplateMonth", frames = [self.simpleFrame], pagesize=A4, onPage = self.context.footerAndHeader)
</code></pre>

python barcode reportlab