Skip To Content

Share a print service web tool with custom layouts from ArcGIS Pro

When you need printing capabilities in ArcGIS Enterprise outside the scope of the default PrintingTools service, you can create layouts in ArcGIS Pro and share them to your portal as a web tool.

You should not update the layouts that come with the default PrintingTools service, nor add new layouts and republish this service. Instead, you should run the Export Web Map script tool in ArcGIS Pro and share the result as a web tool, serving as an additional resource for web map printing.

As with any web tool, the result of this tutorial will be shared to the ArcGIS Enterprise portal where you're signed in, and the geoprocessing service that underlies the web tool will be saved to the federated ArcGIS Server you designate.

This topic is similar to Publish additional services for printing in ArcMap. However, that topic uses ArcMap to publish a geoprocessing service to your server; this topic uses ArcGIS Pro to share a web tool with your portal.

Creating a custom layout

If you want to create a custom layout template, you can do so in ArcGIS Pro. See Layouts in ArcGIS Pro for information. Save your new layout to a folder: On the Share tab, in the Save As group, click Layout File. Alternatively right-click the layout in the Catalog pane and choose Save As Layout File.

Considerations when preparing your layouts

There are several best practices to follow when you create layouts in ArcGIS Pro that will be used in an ArcGIS Enterprise portal:

  • If you have more than one map frame in your layout, identify the map frame you want the web tool to use and name it WEBMAP_MAP_FRAME (case sensitive). The web tool's underlying service will use the map frame named such.
  • Insert dynamic text such as title, author name, and so on. To learn more about dynamic text, see What is dynamic text? in the ArcGIS Pro documentation. To do so:
    1. From the Insert tab of the ribbon, select the Text command in the Text group.
    2. Click on a location on the layout to position the new text element.
    3. Open the Property page for the text element.
    4. Insert one of the following tags into the selected element's Text property:


      <dyn type="layout" property="metadata" attribute="title" emptyStr=""/>


      <dyn type="layout" property="metadata" attribute="contactname" emptyStr=""/>


      <dyn type="layout" property="metadata" attribute="credits" emptyStr=""/>
  • You can also add the Current Time dynamic text element from the System category in the Dynamic Text drop-down. This is also located in the Text group of the Insert ribbon.
  • If you want to insert a custom text element, add a text element and embed the element's name in a set of open and closed curly braces, such as {parcel-id}.

Do not insert the User dynamic text into the layout. This dynamic text will populate with sensitive information about the print service.

Registering your layout templates folder with ArcGIS Server

To create and share the web tool with ArcGIS Enterprise, the folder containing your layout templates must be accessible to ArcGIS Server. If the folder is accessible to the server, you can register it with the server; otherwise, copy the folder's contents to the server from ArcGIS Pro when you share the web tool.

See Manage registered data stores in the ArcGIS Pro help for instructions.

Preparing and sharing the web tool

When you're ready, run the Export Web Map script tool using the folder containing your custom layout templates. Next, run the Get Layout Templates Info script tool, referencing the same folder. Then share the results as a web tool.

  1. In the Geoprocessing pane, browse to Toolboxes > Server Tools > Printing.
  2. Double-click the Export Web Map tool to open it.
  3. Leave the Web Map as JSON parameter as #.

    To get printable images, users of this service will submit their own web map JSON for this parameter. The printing widgets in the ArcGIS web APIs, ArcGIS Enterprise app templates, and Web AppBuilder for ArcGIS generate this JSON.

  4. Leave the Output File parameter as is.

    Once you publish this tool to the server, the output is placed in the server jobs directory.

  5. For the Layout Templates Folder parameter, click the browse button and browse to the folder where your layouts are stored.

    If you only want to reference the basic layouts installed with ArcGIS Enterprise, leave this parameter blank.

  6. Optionally choose a layout from the Layout Template drop-down list.

    This will be the default layout when users run your service.

  7. Click Run to run the tool.
  8. Browse to Toolboxes > Server Tools > Printing and double-click the Get Layout Templates Info script tool to open it.
  9. The Get Layout Templates Info script tool allows you to add the Get Layout Templates Info task to print services. The task provides the size of the layout page and the size of a map frame. It also shows whether the following layout elements are available:

    • Legend
    • Title text
    • Copyright text
    • Author text
    • Custom text elements

  10. Choose the same Layout Templates Folder that you specified when running the Export Web Map tool in step 5. Click Run to run the script.
  11. On the Analysis tab on the ribbon, click History, or click the History tab in the Catalog pane. Right-click the Export Web Map result, and choose Share As > Web Tool.

    The Share As A Web Tool dialog box appears.

  12. Use the Analyze option to identify any possible issues.
  13. On the General tab of the dialog box, replace the defaults in Item Details (name, summary, and tags) as necessary. If you registered the layout templates folder with the server as described above, choose the Reference registered data option; otherwise, choose Copy all data. Designate the portal folder where you want the web tool saved and the federated ArcGIS Server site and server folder where you want its underlying geoprocessing service saved. Then, set the sharing options for this web tool.
  14. Switch to the Configuration tab. Specify an Execution Mode for the tool in the Parameters section. In most cases, you'll choose Synchronous. Choose Asynchronous if you expect requests to the tool to take more than a few seconds (such as when printing a large, detailed map). Then, set a logging Message Level for the tool.
  15. Switch to the Content tab. Click Add Tool and add the Get Layout Templates Info result .

    Both of the tools you ran are now incorporated into this web tool.

  16. Click Share to share the web tool.
  17. Verify that your web tool published correctly; it should be available in your ArcGIS Enterprise portal, and its underlying geoprocessing service should be available in ArcGIS Server Manager.

Your new web tool can now be referenced in the printing widgets offered by the ArcGIS web APIs, as well as in the portal Map Viewer. The URL for the web tool is available from its item page in the ArcGIS Enterprise portal.

The web tool is powered by a custom service in your federated ArcGIS Server site. You can designate this service as your ArcGIS Enterprise portal's printing service. Open ArcGIS Server Manager and locate the service, then copy its URL, including the Export Web Map task, and paste it in the Utility Services dialog box for Printing.

Updating the layout templates

If you want to update the layouts in your layout templates folder, the appropriate workflow is determined by whether you registered the layout templates folder with the server before publishing (see the "Registering your layout templates with ArcGIS Server" section above). It also matters whether you want to add a new layout to the folder or just update an existing layout. This is because the geoprocessing task you created keeps a list of the layouts that were in your layout template folder at execution time.

If you registered your layout templates folder with the server before publishing, this means the server can see your layouts. If you make updates to existing layout files (.pagx) in the folder, your modified layouts will be immediately available. However, the server will not see any new layouts you add after sharing the web tool.

Accordingly, if either of the following are true, you will need to redo the workflow above and share a new web tool for your changes to be available to your ArcGIS Server users:

  • You did not register your layout templates folder with the server prior to sharing the web tool, meaning the layouts were copied to the server at the time of publishing.
  • After sharing the web tool, you want to add a new layout template to the folder and make it available to your users.