Code Gallery
Print Layout Task / Server Object Extension for .NET Web ADF (Windows installer)
|
Updated: The previous version produced unexpected output results when using a user-specified scale.
This update uses the PageLayout object to scale the view, producing result images closer to the supplied scale. This demo adds printing capabilities to the .Net WebADF framework. The custom task allows you to generate high-quality maps from a web browser and export maps to pdf, jpeg, ai, and other formats. Using the task, you can select the configuration of your final map product by selecting from several ArcMap preconfigured layouts; you can also change the content of text elements on the fly. Originally developed by Ismael Chivite. Updated to support ArcGIS Server 9.3 and to accept a user-defined map scale for the output. Use the separate manual-installation version if you are installing on a 64-bit operating system or if you otherwise have problems using this installer.
|
Report Inappropriate Content: This Code Gallery is intended for the free exchange of code related to ESRI software products. Let us know if this entry is inappropriate (e.g., a download for a commercial product).

Imagery posted by mmarino80 on Nov 05, 2008 11:17 AM
For some reason I can export/print everything in my TOC except for my imagery. All I get is a little bit in the corner. Has this happened to anyone else?
Multiple Services posted by mvanhook on Nov 10, 2008 12:58 PM
We cannot use the print task if we use more than one service (Layer in App TOC), including the ESRI services. Works OK with only one service. Is there a fix?
Error using task posted by dmonego on Nov 11, 2008 2:06 PM
When I try to use this task, I get the following error in a text file on the output directory: Error on function 'Export. Error description: Value does not fall within the expected range. Is this a known error?
Multiple Services posted by markdeaton on Nov 18, 2008 1:43 PM
mvanhook: Server Extensions are enabled on a server-by-server basis. So server extension functionality can only be designed to run against one service at a time. Unfortunately, the task appears along with the map table of contents, making it *appear* as if it is supposed to work with all layers/services at once. Currently the task is built to work on only one service in the map. You can see this in the "Tasks" tab of the Server Manager while you're building the application. It would be possible to update it to export the layout on any and all services that have been PrintLayout-enabled. But even then, it would have to invoke the export on each service separately, resulting in a series of separate layouts. The best way to export exactly the data layers you want is to add all desired layers to your MXD; make sure they all look nice in the print layout view; and then publish to server with PrintLayout capability enabled. Hope that helps, Mark
Multiple Services posted by markdeaton on Nov 18, 2008 1:54 PM
Quick correction: that should read "Server Extensions are enabled on a service-by-service basis."
Imagery posted by markdeaton on Nov 19, 2008 10:26 AM
I was able to export imagery. I don't know your exact data or configuration, but here's what I did: * Created a new map doc * Added the sample US States polygon feature class * Added the standard imagery from ArcGIS Online * Saved and published the map doc with print layout extension enabled * Exported to PDF Can you provide more details on how you set up your service?
Error using task posted by markdeaton on Nov 26, 2008 10:41 AM
A search for that error ("value does not fall within the expected range") at support.esri.com brings up many hits for a wide variety of reasons. This appears to be thrown by ArcObjects, so it may have something to do with the map document or data you've put together. Are you using data from SDE? If so, can you try the same thing with a service built from a simple shapefile? That will narrow down the problem a bit.
Questions on Customizing posted by gbarden on Nov 26, 2008 10:53 AM
Great Extension! I just have a couple of questions about using this with my own map services. First, I can't seem to get a Legend to show up, is there something I need to do similar to creating the dynamic text? Second, the Layout dialog box is "clear" when I use my own layout. It looks like the input fields are just floating without a frame around them. Any help will be greatly appreciated.
question will task print from redlining task 15751 posted by MargoMcMurdo1604 on Dec 03, 2008 3:45 AM
Mark, thanks for code - great. Will your Print Layout Task print the graphics produced with the Redlining Task for 9.3 (script id 15751)?
User defined scale doesn't work posted by AndrewRitchie on Dec 09, 2008 7:48 PM
Trying to print to a custom template, the user defined map scale calculations are way off. My Map is set at the desired scale, 1:500. 500 is also entered as the user defined scale in the Print Task. Assuming a maximised window, the ouput created is a 1:679 map (which changes depending on screen size) The Task does _try_ to scale the map, as it changes both the height and width extents. (Leaving the scale field blank will produce a map, to the same width as the viewable area, but will change the height extents to fill the template, or vice versa for Layout orientation)
IExplorer load so slow posted by gbermudez on Dec 11, 2008 5:02 AM
I used this task in my develop enviroment but I implant this in a productive server and when I open the page IExplorer is very slow, I have to wait 8 minute to see the page and when I run the task it's so slow too. Without Layout Task the page load perfectly.
Imagery and scale issues posted by ddp_developer on Dec 11, 2008 3:51 PM
I add ArcGIS Online basemaps during page_Load dynamically but I have also tried to add them to the .mxd that I publish and neither method seems to export anything but my local data. I also cannot get the local data to export at anything other than full extent. I zoom my map closer, try to export, but the map generated is still full extent and no basemap (imagery or street data). Any ideas? Thanks in advance, David
Error using Task 2 posted by LILJERRY on Mar 02, 2009 8:36 AM
I'm also getting the "Value does not fall within the expected range" and didn't know if this has a resolution?
Highlighted Results posted by Tink0519 on Mar 16, 2009 8:25 AM
Does this task print highlighted feature graphics? I can not get the results to show up on the exported map.
Re: Highlighted Results posted by sgavathe on Mar 28, 2009 2:28 PM
Tink0519, You have to modify the Task LayoutSOE in order to get the highlighted features printed. Modify the renderers and you should be good.
Re: User defined scale doesn't work posted by gamreddy on May 18, 2009 10:49 AM
Andrew Ritchie, I had the similar problem but after changing the template scaling started working. Try printing with other templates.
mutiple services posted by hmahdi on May 29, 2009 11:46 AM
can not print multiple services
Using server object extensions when publishing a .MSD file?? posted by ddp_developer on Jun 12, 2009 8:40 AM
I do not have the option to enable this server object extension when I publish a map service definition file (new at 9.3.1 that is needed to support the faster rendering engine for dynamic map services), only when I publish a .mxd file. Is this a known limitation? Thanks, David
Problem printing highlighted layer posted by devgis on Jun 12, 2009 11:20 AM
Does anyone know how to print the highlighted layer? Tink0519, were you able to figure out the solution for this problem.Please let me know.Thanks
Problem after upgrade to 9.3.1 posted by evtinker on Aug 15, 2009 7:45 AM
I have been trying to install and use this extension for about two weeks now with only limited success. Yesterday we stripped the server completely back down, reformatted the drives and started over. I setup the server at 9.3 and installed the extension. It worked perfectly. I then upgraded to 9.3.1 and now have problems. When using Arc Catalog to add the the LayoutSOE function to a published map service the check box is visible but there is no text next to it, just the check box. When checked it does function correctly and layout mxds can be added. When a web application is created the Print Layout Task can be added as expected and the application functions. When the application is used though, the Print Layout window displays without a background. Apparently some sort of skin file has been overwritten or changed by the 9.3.1 upgrade, Does anyone know how to correct this?
Re: Problem after upgrade to 9.3.1 posted by evtinker on Aug 17, 2009 1:25 PM
I deleted the applications and map services, ran the regasm commandes and recreated the services and applications. The fixed the background problem for the end users in the web ap, but catalog still shows just a check box with no text next to it.
layout capability not listing posted by hazelton_glenn on Sep 29, 2009 10:53 AM
hi i have installed the printlayouttool without issue. and i am using it. the problem i have is that there is nothing listed next to the checkbox in arccatalog. i am able to check it and select the template to use. but the discription is missing. how do i correct this? i love the tool.
Installation posted by Ed.Hawkins on Oct 28, 2009 7:39 AM
How do I install this product?
Problem compiling posted by m23141 on Oct 30, 2009 6:29 AM
Howdy, When I try to compile the solution in PagePRinter.cs line 857 I get the error: 'ESRI.ArcGIS.ADF.Web.UI.WebControls.Toc' does not contain a definition for 'CreateLegendNodeTree' Any thoughts on why this might be?
If you would like to post a comment, please login.