Skip To Content

Printing maps that contain secured services

You can use the PrintingTools service to print maps that contain secured services. However, depending on how you secure your services or web apps, you may need to create a custom print service to print secured services. This is described in the following sections.

If you use short-term tokens to secure services

If you secure your services using short-term tokens (the default), the user will be challenged to provide the name and password upon opening the web app. The token is then passed to the PrintingTools service when the user requests a map to be printed. There is no need to create a custom print service (as described below) if you are using short-term tokens.

If you embedded a long-term token in your web app code

If you embedded a long-term token in the code of your web app, the authentication information being passed to the PrintingTools service will be invalid. In this scenario, you'll need to publish your own service for printing using the steps below. When preparing this service, you'll provide credentials that it can use when requesting maps from secured services.

  1. In the Catalog window of ArcMap, expand Toolboxes > MyToolboxes.
  2. Right-click My Toolboxes and click New > Toolbox.
  3. Give your toolbox a name, such as SecurePrinting.tbx.
  4. In the Catalog tree, expand Toolboxes > System Toolboxes > Server Tools.tbx > Printing.
  5. Right-click the Export Web Map tool and click Copy.
  6. Right-click your toolbox that you created in Step 2 and click Paste.
  7. Right-click the pasted Export Web Map tool from your own toolbox and click Edit.
  8. Click the plus (+) button and browse to the GIS server connection containing the secured services you will print.

    The connection needs to have the name and password saved within it. It should be a user connection, not a publisher or administrative connection.

    If you don't see any connections available, you need to go back to the Catalog tree and make one using the instructions in Making a user connection to ArcGIS Server in ArcGIS for Desktop.

    You can add connections to as many servers as you need to support your printing service. Click OK when you've finished adding connections.

  9. Publish the Export Web Map tool from your own toolbox as a geoprocessing service using the steps in Tutorial: Publishing additional services for printing. In Step 2 of the tutorial, open your own Export Web Map tool you pasted during the steps above. Do not open the original Export Web Map tool from the Server Tools toolbox.
    Caution:

    Once you publish your own service for printing, it's recommended that you apply ArcGIS Server security rules to restrict who can access the service. This prevents anonymous users from generating printable map images that display your secured services. See Restricting access to GIS web services to learn more about setting up security.