<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Changing from landscape to portrait orientation in ReportLab. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/changing-from-landscape-to-portrait-orientation-in/m-p/539767#M42206</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For all of those who may use Reportlab,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a newbie question (should be simple to answer) that has been bugging me for the past day or so and after pouring over all online posts related to reportlab still can't be figured out.&amp;nbsp; All I am trying to do is switch from landscape to portrait orientation in the same document.&amp;nbsp; This will allow me to create a table of features (including links to the pictures of these within the table) and then put in the pictures so they can be linked to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code I have come up with so far to facilitate what should be a straight forward process:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib import colors&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib.pagesizes import letter, landscape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, Frame, Table, TableStyle, NextPageTemplate, PageTemplate, BaseDocTemplate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib.units import inch&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.platypus.flowables import Flowable, PageBreak&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from pyPdf import PdfFileReader, PdfFileWriter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import glob, os&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib.pagesizes import letter, A4&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;doc = BaseDocTemplate("M:\GIS Mapping Services\Promotional\Automated Reports\PDF_ReportLab\NextPageExample.pdf",showBoundary=1,pagesize=landscape(letter))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements = []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;styles = getSampleStyleSheet()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;styles.add(ParagraphStyle(name='normal', fontSize=6, leading = 7, alignment=TA_LEFT))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ptemplate = PageTemplate(id='portrait', pagesize=portrait(letter))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements.append(Paragraph("Table is here.",styles["normal"]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements.append(NextPageTemplate('portrait'))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements.append(PageBreak())&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements.append(Paragraph("Pictures are to be placed here.",styles["normal"]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;doc.build(elements)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del elements&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have any tips or would like to help me out with this can you please be specific and show me exactly what I am doing wrong or include a working example that goes from start to finish without any coding missing.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance for your help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Winn&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Mar 2013 21:02:45 GMT</pubDate>
    <dc:creator>WinnKetchum</dc:creator>
    <dc:date>2013-03-11T21:02:45Z</dc:date>
    <item>
      <title>Changing from landscape to portrait orientation in ReportLab.</title>
      <link>https://community.esri.com/t5/python-questions/changing-from-landscape-to-portrait-orientation-in/m-p/539767#M42206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For all of those who may use Reportlab,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a newbie question (should be simple to answer) that has been bugging me for the past day or so and after pouring over all online posts related to reportlab still can't be figured out.&amp;nbsp; All I am trying to do is switch from landscape to portrait orientation in the same document.&amp;nbsp; This will allow me to create a table of features (including links to the pictures of these within the table) and then put in the pictures so they can be linked to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code I have come up with so far to facilitate what should be a straight forward process:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib import colors&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib.pagesizes import letter, landscape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, Frame, Table, TableStyle, NextPageTemplate, PageTemplate, BaseDocTemplate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib.units import inch&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.platypus.flowables import Flowable, PageBreak&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from pyPdf import PdfFileReader, PdfFileWriter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import glob, os&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from reportlab.lib.pagesizes import letter, A4&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;doc = BaseDocTemplate("M:\GIS Mapping Services\Promotional\Automated Reports\PDF_ReportLab\NextPageExample.pdf",showBoundary=1,pagesize=landscape(letter))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements = []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;styles = getSampleStyleSheet()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;styles.add(ParagraphStyle(name='normal', fontSize=6, leading = 7, alignment=TA_LEFT))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ptemplate = PageTemplate(id='portrait', pagesize=portrait(letter))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements.append(Paragraph("Table is here.",styles["normal"]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements.append(NextPageTemplate('portrait'))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements.append(PageBreak())&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elements.append(Paragraph("Pictures are to be placed here.",styles["normal"]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;doc.build(elements)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del elements&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have any tips or would like to help me out with this can you please be specific and show me exactly what I am doing wrong or include a working example that goes from start to finish without any coding missing.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance for your help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Winn&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 21:02:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-from-landscape-to-portrait-orientation-in/m-p/539767#M42206</guid>
      <dc:creator>WinnKetchum</dc:creator>
      <dc:date>2013-03-11T21:02:45Z</dc:date>
    </item>
  </channel>
</rss>

