<?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 Printing in ArcPy?? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/printing-in-arcpy/m-p/648012#M21677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I saw the blog post below suggesting that a Geoprocessing Service could be created to utilize ArcPy and the Printer Settings but I still have many questions.&amp;nbsp; Is a PDF produced or is the print sent straight to the printer?&amp;nbsp; Some of the parameters seem to want to point to the actual MXD and actual printer so could I use a URL to the MXD and printer?&amp;nbsp; What would help me the most is if anyone has one complete sample of what this script should look like? I would just need one print size in the example code not all of them for simplisity sake.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2010/02/01/ArcPy-and-Geoprocessing_2620_-it_1920_s-for-Developers-too.aspx"&gt;http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2010/02/01/ArcPy-and-Geoprocessing_2620_-it_1920_s-for-Developers-too.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Dec 2010 11:11:08 GMT</pubDate>
    <dc:creator>JoshV</dc:creator>
    <dc:date>2010-12-16T11:11:08Z</dc:date>
    <item>
      <title>Printing in ArcPy??</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/printing-in-arcpy/m-p/648012#M21677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I saw the blog post below suggesting that a Geoprocessing Service could be created to utilize ArcPy and the Printer Settings but I still have many questions.&amp;nbsp; Is a PDF produced or is the print sent straight to the printer?&amp;nbsp; Some of the parameters seem to want to point to the actual MXD and actual printer so could I use a URL to the MXD and printer?&amp;nbsp; What would help me the most is if anyone has one complete sample of what this script should look like? I would just need one print size in the example code not all of them for simplisity sake.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2010/02/01/ArcPy-and-Geoprocessing_2620_-it_1920_s-for-Developers-too.aspx"&gt;http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2010/02/01/ArcPy-and-Geoprocessing_2620_-it_1920_s-for-Developers-too.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Dec 2010 11:11:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/printing-in-arcpy/m-p/648012#M21677</guid>
      <dc:creator>JoshV</dc:creator>
      <dc:date>2010-12-16T11:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Printing in ArcPy??</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/printing-in-arcpy/m-p/648013#M21678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If a parameter wants the MXD you need to create an MXD object with the "CURRENT" path so that the print functions know that you want to use the MXD that is open at the moment. The print could be sent to either a printer or to PDF depending on what you want to happen. I havnt written anything like this for a service but it isnt complicated to do from the desktop environment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Dec 2010 14:45:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/printing-in-arcpy/m-p/648013#M21678</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-12-16T14:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Printing in ArcPy??</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/printing-in-arcpy/m-p/648014#M21679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If a parameter wants the MXD you need to create an MXD object with the "CURRENT" path so that the print functions know that you want to use the MXD that is open at the moment. The print could be sent to either a printer or to PDF depending on what you want to happen. I havnt written anything like this for a service but it isnt complicated to do from the desktop environment.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you see any problems with my below code??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import sys, arcpy

arcpy.env.overWriteOutput = True

mxdTemplate = "CURRENT" #or a different mxd

outWs = "D:\\GIS Data\\arcgisserver\\arcgisoutput" #can really be any directory

outFileName = "print_service_output.pdf"

ext = arcpy.Extent(-96.597, 34.742, -96.225, 35.055)

outFilePath = outWs + "\\" + outFileName

mxdTemplateObject = arcpy.mapping.MapDocument(mxdTemplate)

df = arcpy.mapping.ListDataFrames(mxdTemplateObject)[0]

df.extent = ext

arcpy.mapping.ExportToPDF(mxdTemplateObject, outFilePath)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:28:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/printing-in-arcpy/m-p/648014#M21679</guid>
      <dc:creator>JoshV</dc:creator>
      <dc:date>2021-12-12T03:28:53Z</dc:date>
    </item>
  </channel>
</rss>

