<esri:Geoprocessor id="gp" jobComplete="openPDF(event)" url="http://arcgis.allconet.org/ArcGIS/rest/services/PermitDashboard/GPServer/PrintToScale" showBusyCursor="true"/> public var urlPDF:String = "http://arcgis.allconet.org/PrintToScalePDF/Print_Output.pdf"; private function submit():void { var params:Object = {inMinX:map.extent.xmin.toString(), inMinY:map.extent.ymin.toString(), inMaxX:map.extent.xmax.toString(), inMaxY:map.extent.ymax.toString(), inScale:txtScale.text}; gp.submitJob(params); } private function openPDF(event:GeoprocessorEvent):void { var urlRequest:URLRequest = new URLRequest(urlPDF); navigateToURL(urlRequest);
import arcgisscripting import os # Import arcpy module import arcpy from arcpy import env # Set active MXD, Data Frame, and Layer mxd = arcpy.mapping.MapDocument(r"D:\AGIS_MXDs\PermitPrintToScale.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] # Script arguments minX = arcpy.GetParameterAsText(0) if minX == '#' or not minX: minX = 727834 minY = arcpy.GetParameterAsText(1) if minY == '#' or not minY: minY = 649034 maxX = arcpy.GetParameterAsText(2) if maxX == '#' or not maxX: maxX = 938634 maxY = arcpy.GetParameterAsText(3) if maxY == '#' or not maxY: maxY = 754900 mapScale = arcpy.GetParameterAsText(4) if mapScale == '#' or not mapScale: mapScale = 100 # Set Data Frame to the extents passed from Flex newExtent = df.extent newExtent.XMin, newExtent.YMin = float(minX), float(minY) newExtent.XMax, newExtent.YMax = float(maxX), float(maxY) df.extent = newExtent # Set scale of the Data Frame to the value passed from flex # Multiply by 12 to adjust to geographic scale df.scale = float(mapScale) * 12 # Print to PDF arcpy.mapping.ExportToPDF(mxd, r"C:\Inetpub\wwwroot\PrintToScalePDF\Print_Output.pdf")
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.