<?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 Re: Use of exportwebmap from printing toolset  in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/use-of-exportwebmap-from-printing-toolset/m-p/402877#M13660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatley not. I tried but did not find any solution. Then I implemented my print service through:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;result = arcpy.mapping.ConvertWebMapToMapDocument(mapAsJson, templateMxd)&lt;BR /&gt;mxd = result.mapDocument&lt;/P&gt;&lt;P&gt;outputName = 'WebMap_{}'.format(str(uuid.uuid1()))&lt;BR /&gt;outputFile = os.path.join(arcpy.env.scratchFolder,outputName)&lt;BR /&gt;if fileFormatLower == 'pdf':&lt;BR /&gt;## arcpy.mapping.ExportToPDF(mxd, outputFile, resolution = int(dpi))&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.mapping.ExportToPDF(mxd,outputFile)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;outputFile = outputFile+".pdf"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I had to implement for each format. I followed this documentation.&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/exporttopdf.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/exporttopdf.htm"&gt;ExportToPDF—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully, it will help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ayyaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Oct 2019 19:30:38 GMT</pubDate>
    <dc:creator>AyyazMahmood-Paracha</dc:creator>
    <dc:date>2019-10-23T19:30:38Z</dc:date>
    <item>
      <title>Use of exportwebmap from printing toolset</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-of-exportwebmap-from-printing-toolset/m-p/402875#M13658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need one guidance regarding&amp;nbsp;the utilsiation of task arcpy.ExportWebMap_server.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use this task in one of my geo processing synchrone service. During my unit testing, I publish the following geo processing service:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;arcpy.env.workspace="/app/testprint"&lt;/P&gt;&lt;P&gt;WebMapAsJson = arcpy.GetParameter(0)&lt;BR /&gt;FormatPrint = arcpy.GetParameterAsText(1)&lt;BR /&gt;LayOutTemplate = arcpy.GetParameterAsText(2)&lt;BR /&gt;PrintName = arcpy.GetParameterAsText(3)&lt;BR /&gt;testPrintCommand = arcpy.ExportWebMap_server(Web_Map_as_JSON=WebMapAsJson, Output_File=PrintName, Format=FormatPrint, Layout_Templates_Folder="", Layout_Template=LayOutTemplate)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;When I execute this code through Python installed on server, the code runs and generates a PNG in the folder /app/testprint without any error. Whereas when I publish the geo-processing service, the code returns me the output filename (\\app\testprint\&amp;lt;filename&amp;gt;.png)&amp;nbsp;but no file is generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please guide me, how can I can make this code works. Any guidance or clue will be useful for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 18:43:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-of-exportwebmap-from-printing-toolset/m-p/402875#M13658</guid>
      <dc:creator>AyyazMahmood-Paracha</dc:creator>
      <dc:date>2019-07-22T18:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exportwebmap from printing toolset</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-of-exportwebmap-from-printing-toolset/m-p/402876#M13659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ayyaz, Did you ever get to the bottom of this?&amp;nbsp; I'm having exactly the same problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Neil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Oct 2019 12:31:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-of-exportwebmap-from-printing-toolset/m-p/402876#M13659</guid>
      <dc:creator>NeilEtheridge</dc:creator>
      <dc:date>2019-10-20T12:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use of exportwebmap from printing toolset</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-of-exportwebmap-from-printing-toolset/m-p/402877#M13660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatley not. I tried but did not find any solution. Then I implemented my print service through:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;result = arcpy.mapping.ConvertWebMapToMapDocument(mapAsJson, templateMxd)&lt;BR /&gt;mxd = result.mapDocument&lt;/P&gt;&lt;P&gt;outputName = 'WebMap_{}'.format(str(uuid.uuid1()))&lt;BR /&gt;outputFile = os.path.join(arcpy.env.scratchFolder,outputName)&lt;BR /&gt;if fileFormatLower == 'pdf':&lt;BR /&gt;## arcpy.mapping.ExportToPDF(mxd, outputFile, resolution = int(dpi))&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.mapping.ExportToPDF(mxd,outputFile)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;outputFile = outputFile+".pdf"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I had to implement for each format. I followed this documentation.&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/exporttopdf.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/exporttopdf.htm"&gt;ExportToPDF—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully, it will help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ayyaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2019 19:30:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-of-exportwebmap-from-printing-toolset/m-p/402877#M13660</guid>
      <dc:creator>AyyazMahmood-Paracha</dc:creator>
      <dc:date>2019-10-23T19:30:38Z</dc:date>
    </item>
  </channel>
</rss>

