The Print task allows the user to print the map along with any task results they choose. When invoked from the Web application, the task displays a printing dialog box that allows the user to enter a title for their map, set the map size and quality, and choose any task results to print under the map. Clicking the button to create the printed page opens a new browser window with a preview of the printed page. The user can then print to any available printer.
The Print task doesn't require any configuration in Manager unless you want to change the default settings that Manager provides. For example, you can change the default map title and select the legend items that you want to print.
To add and configure the Print task in Manager, follow these guidelines:
- When creating or editing a Web application in Manager, in the Tasks step, use the Add Task option to add the Print task to the list of tasks. Click the Print task and click Configure, which displays the configuration dialog box for the Print task.
- On the General tab, optionally change the Task Name, which is displayed in the list of available tasks on the menu bar of the application. You can also change the Button Text, which is shown on the button the user clicks to create the print preview page.
- The Settings tab determines default settings for the print page. End users can change some of these settings when they run the Print task, while others are configurable only by you as the server administrator.
- Title determines what prints across the top of the page by default. The user can modify this setting.
- Map Size determines the default size of the map. The user can still choose the size from a pick list when running the Print task.The standard sizes correspond to the following: Small (3 inches by 3 inches), Medium (5 inches by 5 inches), and Large (7 inches by 7 inches). These sizes (including units) can be customized as described in the developer help.
- The Print results only (no map) option sets whether to print only task results (if any) by default. The user can change this setting when running the Print task.
- The Map Quality setting determines the quality of the map image. Draft prints the map at 96 dots/pixels per inch (dpi), which is sufficient for previewing on the screen but does not give the best quality when printed. Normal prints the map at 200 dpi. The Normal setting improves the appearance of the map when printed, although when displayed in print preview, it may look poorer due to interpolation of the higher-resolution image. The user cannot change this setting when running the Print task.
- The Scale or Extent setting allows you to choose whether the printed map will preserve the map scale or the map extent that users see in the browser. Only one of these properties can be preserved to produce a high-resolution map for printing. If you choose to preserve map scale, the map displayed in the print window matches the current scale of the map in the application. Alternatively, if you choose to preserve map extent, the current extent of the map in the application displays in the print window but the scale may change. The default is set to preserve map scale. The user cannot change this setting when running the Print task.
- The Map Elements tab sets the items that appear on the printed page. You can choose to include a scale bar, north arrow, and legend. You can also set the layers to be shown or hidden from the legend and the number of columns you want. Layers hidden in the legend are not hidden from display on the map. This option might be useful if you have many layers in the map, of which only certain ones need to be included in the legend.
You can edit your completed application in Visual Studio or Visual Web Developer Express to get more control over Print task properties such as width settings, quality settings, and north arrow settings. However, you have to set these properties for every Web application you create.
The Print task uses a configuration file to store the predefined values. Thus, if you want to replace these values with your own values, you can do so by editing the configuration file in a text editor. Any newly created applications then use the new predefined values.
The configuration file is located in the folder <installation_location>/Dotnet and is called ESRI.ArcGIS.ADF.Tasks.dll.config. To change the page size or print quality names that display (for example, "Small", or "Draft"), add a new attribute called Name. This overrides the current predefined value, which is stored in a resource file for localization purposes. For example, here is one entry for the page size with Name added:
<Size ID="PrintTaskSize0" Name="Small Map" SizeHeight="3.0" SizeWidth="3.0" Unit="Inches" />
When setting the page size and quality, keep in mind that the GIS server imposes limits on the maximum image size it can return. For example, ArcGIS Server map services, by default, restrict the image size to a maximum of 2048 x 2048 pixels. This means that a 10-inch-square map with a quality of 200 dpi is 2000 x 2000 pixels. If the Print task map request exceeds the limits of the GIS server, the particular service does not print.
See the Print Task discussion in the ArcGIS Server Developer Help to learn more about working with the Print task in a development environment.