Once a map is constructed, the ability to output a publishable copy of the map is usually required, either to use as an image in a document or as a standalone item for plotting or printing. In my work, I usually need an image file that can be used in a report, a PowerPoint presentation or a poster presentation. Generally, an Adobe Acrobat (pdf) file will be created as a standalone map. Sending the final map directly to a server is not part of this discussion. In this section, the user will explore different electronic formats and resolutions for the output map. Create a map with proper formatting in Esri ArcMap, with items such as title, legend, text box, scale and directional arrow.
In this example, the user will export a PNG format image file at a resolution of 600 dpi. The mapping module and a new command ExportToPNG are used to accomplish the task. The export operation only requires a few lines of code. This operation could be done inside or outside of Esri ArcMap in this case it was done in an IDE.
Exporting Adobe Acrobat File Part 1
Exporting a pdf file is similar to the previous discussion of exporting an image, see Figure 20. The only difference is in the export statement a different export command is used. All the notes for the lines of code in the image export are the same, except the command is ExportToPDF. In Figure 17 note, a pdf file with the name west-end.pdf already exists from a previous project. The output name for the pdf file will be west-end2.pdf, see Figure 19 and Figure 20. The user should not attempt to overwrite a file.
Many times the user will be required to create several maps of the same area. For a typical demographic research project, the user might need to make maps of Population, Income, Education Attainment, Race, Gender, Ethnicity, Housing Type, Geography (rivers and roads), Political Division (townships, towns, cities, place names). It is a time consuming process to manually create each file and then add them into a single pdf document. The Map Book command will create a single pdf containing multiple pdf files that were previously created. The pdf files could have been previously created as part of the same operation as discussed in Part 1.
- The pathway to the first pdf file is established with the path variables other pdf files will be hard coded as parameters.
- ThePDFDocumentCreate command is used and the parameter is the location to put the pdf file.
- Two files are appended using the appendPages command to the original document created.
- The last part of the appending is closing and saving the document with the saveAndClose command. No parameters are given to this command.
- The final line of the script is the deleting of the document variable to insure that no locks will cause problems.