Select to view content in your preferred language

Create PDF ?

12877
76
07-20-2010 06:02 AM
CraigPerreault
Deactivated User
Does anyone have a code sample to create a PDF file using the Silverlight API?
0 Kudos
76 Replies
JonathanHouck
Occasional Contributor
Well you'll notice in the script, it will have this for example:

xMin = arcpy.GetParameterAsText(0)
if xMin == '#' or not xMin:
    xMin = "4357197" # provide a default value if unspecified

yMin = arcpy.GetParameterAsText(1)
if yMin == '#' or not yMin:
    yMin = "1414133" # provide a default value if unspecified

xMax = arcpy.GetParameterAsText(2)
if xMax == '#' or not xMax:
    xMax = "4357210" # provide a default value if unspecified

yMax = arcpy.GetParameterAsText(3)
if yMax == '#' or not yMax:
    yMax = "1414160" # provide a default value if unspecified


So you're setting these variables that the script will use equal to the arcpy.GetParameterAsText, and that GetParameterAsText method is what's reading the jobParameters that you're passing into the script. It goes to work once it receives them all.
0 Kudos
JayKappy
Frequent Contributor
I think I am on the right path here....see attached....I simply added the toolbox and it placed the script in there....i opened the script and everythign seems to be there...
I dont think I need to do anything else besides publish to ArcServer...that seem correct?
0 Kudos
JonathanHouck
Occasional Contributor
Seems good so far. I believe we went into Published Toolbox > Script Properties > Parameters and configured the data types and other parameter properties. I'm a little hazy on that part, it was awhile ago and we did it once and never revisited it.

I'm looking at the published script now, though, and it does have all the parameters set to match what's in the python and code behind.
0 Kudos
JayKappy
Frequent Contributor
Alright so I think I am started on that path...I have to wait till monday to get that published on their server...
In the mean time can we address the web site of things....Placement of the JS pages on the web root

You simoply copy the ExportMap Folder to the web root? Do you make a folder? Virtual Directory? Confused....seems a bit vague


Web App:
1. Copy the WebApp -> ExportMap folder to you web server wwwroot.
Note: This app uses a proxy page. If you are using a different server technology
you will need to update the proxy accordingly, in the asp folder. Proxy is used for large payloads.
This can occur if a user draws lots of graphics.

2. Update the main.js JavaScript file to point at your map, gp, and proxy services.
lines 49, 65, and 73.

It says to modify the 3 lines below...I am not really sure what to modify...

esri.config.defaults.io.proxyUrl = "asp/proxy.ashx";
Not sure what to change here, just to path to the file?

var opMap = new esri.layers.ArcGISDynamicMapServiceLayer("http://davids/ArcGIS/rest/services/Demo/SaveTheBay/MapServer", {
id: "Operational", opacity: 1.0, visible: true });
Not sure what to change her, what service is this supposed to point too...IS THIS THE MAP? What if I am consuming multiple services from multiple sources....one map dosent work...does the PDF print read all the layers in the active map? Or does it only create the PDF from this map services layers

ep.exportMapGP = new esri.tasks.Geoprocessor("http://davids/ArcGIS/rest/services/Demo/ExportPDF/GPServer/ExportToPDF");
I assume that I chance the location of the ExportPDF service


THANK YOU AGAIN FOR YOUR PATIENCE AND HELP...very appreciated...
0 Kudos
GregoryDillon
Occasional Contributor
Has anybody seen a problem with opacity.   Opacity is working on my dynamic layers but the colors in the PDF don't match the screen.
0 Kudos
GregoryDillon
Occasional Contributor
Has anybody seen a problem with opacity. Opacity is working on my dynamic layers but the colors in the PDF don't match the screen.
0 Kudos
ErikEngstrom
Frequent Contributor
Has anybody made any progress using the geoprocessing export to PDF tool?
Jay, do you have anything to share yet? 😉
My shop is desperately looking for a decently formatted PDF document that will contain the map document, a legend, and a user defined space for a title/notes. I think the geoprocessing route utilizing python is our best bet, but want to be sure before spending a few months in development... Or to contract a service that will do this using SRS.

Thanks!
0 Kudos