Fire Run Book - Street Indexing - StreetIndexReport.py - How to Change Page Size

4052
4
06-19-2014 01:08 PM
Labels (1)
MiguelGarriga
New Contributor II
Is there a way to change the Page Size of the output street index ?  It defaults to 8.5x11 (US Letter size). 

The tool works great, but our map book will be a much larger page size (11x15).
I have looked at the Python script StreetIndexReport.py but do not see any page size settings there.

Thanks in advance for a quick reply!
0 Kudos
4 Replies
MichaelVolz
Esteemed Contributor
I don't have an answer for you now, but can you point me to where I would find the StreetListing.py script?  I would like to take a look as I would like to try to move away from 3rd party software to create mapbooks as the street index is one component that out-of-the-box ESRI software cannot generate so I still use 3rd party software.
0 Kudos
MiguelGarriga
New Contributor II
Hi Michael,

I got the name of the tool wrong - not sure why I wrote "StreetListing.py"; the tool I meant is StreetIndexReport.py from the Fire Run Book.

The ArcGIS 10.1 Fire Run Book toolbox can be downloaded here:
http://www.arcgis.com/home/item.html?id=b38c6c3fff844eda9b33ff54b24a349b

Note the link for the 10.2 version currently has the wrong toolbox, so use the 10.1 version for now.  Once Esri fixes the download, the link will be:  http://www.arcgis.com/home/item.html?id=4e531fdbd9554105bdc5878220df5868

The 10.1 StreetIndexReport.py creates a nice index, but it would be great if we could change the page size.

Good luck!
0 Kudos
MiguelGarriga
New Contributor II
OK, I have a partial answer.  If you want to use a 'standard' page size, it is easy to change. 

The StreetIndexReport.py gets its pagesize from reportlab - see line below from StreetIndexReport.py:
from reportlab.lib.pagesizes import letter, landscape, portrait

If you look in the reportlab source code, under src\reportlab\lib\pagesizes.py, you will see that it defines a number of pagesizes, such as LETTER, LEGAL, ELEVENSEVENTEEN, A0-A6, and B0-B6.  So all you have to do is edit that line in the StreetIndexReport.py and change "letter" to the pagesize you want (ie "LEGAL").  And the index will be generated in the new page size. 

However, you may still need to change other things in the StreetIndexReport.py, because it appears hardwired in other ways for letter size.  For example, inside StreetIndexReport.py, the create_page_portrait and create_page_landscape routines have a number of hardwired  measurements in inches which assume letter size, and you will have to adjust to accomodate other page sizes.  These include measurements for the position of the page number, the word "Index", the vertical lines between columns, horizontal lines, column title, and name of Organization.  Later on in routine create_index_document you will have to create more column definitions in order to take advantage of the additional page size.  So it looks like all of these adjustments are possible, will just take some testing to get it right.

Unfortunately, our page size is not a standard page size.  It is 11.75x15.75.  The reportlab code exists under C:\Python27\ArcGIS10.2\Lib\site-packages\reportlab\lib\pagesizes.py.  I have tried to modify the pagesizes.py to create a custom page size, but no luck yet.  Any Fire Run Book/Python/reportlab wizards out there - would welcome your help.  Thank you!
Zeke
by
Regular Contributor III

FYI, based on Miguel's research, here's a modified version of the StreetIndexReport.py that will print in 11x17" size when in landscape mode. One thing that tripped me up for a while was that pdfs measure from the bottom left, not top like I assumed. So if you need to modify settings, keep that in mind.

Also Miguel, I think you could modify pagesizes.py to add your custom size. Throw it under line 25:

LETTER = (8.5*inch, 11*inch)

LEGAL = (8.5*inch, 14*inch)

ELEVENSEVENTEEN = (11*inch, 17*inch)

MYCUSTOMSIZE = (11.75*inch, 15.75*inch)

Then replace letter with MYCUSTOMSIZE in the script for the tool. Not tested, but that seems like it should work. Then play with page settings to place your elements. It might help to print a sample page and then use a ruler to figure out where you want them.

0 Kudos