title: Apply alignments on Reportlab SimpleDocTemplate to append multiple barcodes in number of rows
body: <p>I am using Reportlab <code>SimpleDocTemplate</code> to create a pdf file. I have to write (draw) multiple images row-wise so that I can adjust many images within the file.</p>
  
  <pre><code>class PrintBarCodes(View):
  
       def get(self, request, format=None):
          response = HttpResponse(content_type='application/pdf')
          response['Content-Disposition'] = 'attachment;\
          filename="barcodes.pdf"'
  
          # Close the PDF object cleanly, and we're done.
          ean = barcode.get('ean13', '123456789102', writer=ImageWriter())
          filename = ean.save('ean13')
          doc = SimpleDocTemplate(response, pagesize=A4)
          parts = []
          parts.append(Image(filename))
          doc.build(parts)
          return response
  </code></pre>
  
  <p>In the code, I have printed a single barcode to the file. And, the output is showing in the images as can be seen below. </p>
  
  <p>But, I need to draw a number of barcodes. How to reduce the image size before drawing to the pdf file and adjust in row fashion?</p>
  
  <p><a href="https://i.stack.imgur.com/NqAeb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NqAeb.png" alt="enter image description here"></a></p>