Enabling High-Quality Printing in Web Applications Tanu Hoque & Jeff Moulds
Print Service Technical Session Outline What s new in 10.6x What is Print Service Out of the box print solutions Print service with my own custom layout template ArcPy based advanced print solution - Include attributes in print output (Popup print) Security
New Modern Print Service with ArcGIS Enterprise 10.6 ArcGIS Pro based print service Quality Improvements: Support for true color level transparency PDF produced with vector features with transparency or picture symbol etc. In Layouts Templates: - are ArcGIS Pro layouts - Unicode support in legend item - Ghost (named Overlay X ) layers removed - Legend patches show with correct fill and outline - Legend patches don t get pixelated - Map scale is computed at the middle of the current map extent RESOLVED Sample incorrect outputs from 10.5.1 or older printing services
What s New? New capabilities: - Vector tile layers - Smart mapping - Vector renderer off raster layers
Migrate to 10.6 You ll want the ArcGIS Server 10.6 Printing and Script Tool Patch Out of box Printing Service (Utilities/PrintingTools) will be upgraded - Your own custom print services will NOT be updated
Client APIs To Work With New Features Requires custom apps using - ArcGIS API for JavaScript 3.24 or above - ArcGIS API for JavaScript 4.6 or above Supported in: - ArcGIS Online map viewer (April 2018 Release) - ArcGIS Enterprise 10.6.1 portal map viewer - Web AppBuilder built into Enterprise portal 10.6.1 - Web AppBuilder Developer Edition 2.8
Publishing Print Service from ArcGIS Pro directly to ArcGIS Server? https://www.esri.com/en-us/about/events/uc/get-involved/q-and-a#id=3191
Print Services
Print Service What it is? Why do I need one?
Why Print Service? Demo
Firewall Public Map Service ArcGIS Online Printing Service with Public Services ExportWebMap JSON Web Application Printing Service on AGOL Output in PDF, PNG etc
Firewall ArcGIS Online Printing Service - Accessing Internal Services ExportWebMap JSON Web Application Printing Service on AGOL Private Map Service
Firewall ArcGIS Online Printing Service with Public Services ExportWebMap JSON Web Application Output in PDF, PNG etc Your Own Printing Service Public Map Service Private Map Service
High Quality Printing on the Web Primary Goals: - Create a printable document (PDF preferably) - Have that document printed to exact scale - Leverage ArcGIS Pro layouts - Support large format plots - Display ALL contents of my Web map - Services, graphics, feature layers, etc. - Be able to modify the map content during the process - High DPI We created a 3 tiered approach to meet these needs
Printing Service Overview Print services are powered by WebMaps - Consistent format produced by all the ArcGIS APIs - JSON based spec for sharing services, graphics, symbols etc. Note: The services in the WebMap must be accessible to the Print Service - Firewalls etc. JavaScript Apps Etc. WebMap Print Service (Export WebMap) PDF etc.
High Quality Printing 3 Tiered Approach : Tier 1 Simple printing Out of the box Geoprocessing Service with ArcGIS Enterprise Small format Synchronous
High Quality Printing 3 Tiered Approach : Tier 2 Custom configuration Ability to supply your own templates Asynchronous if desired Large format
Custom Configuration Publish the Export Web Map tool as your own service - Use your own layout templates - Branding logo, layout design, fonts etc. - Choose to make the service asynchronous if desired - This choice depends on the size of your prints and the length of time they ll take
Publishing Custom Print Service Layout templates Remove all existing layers Updating existing templates will not need republishing - Unless you didn t register template folder to the data store
Retrieving Layout Template Metadata New task with Printing Services to return metadata about available layout templates - It is an arcpy-based script tool. Tool in ArcGIS Pro Task in Service Directory Custom Text Elements showing up in WAB
Retrieving Layout Template Metadata: Task Result { "pagesize": [ 8.5, 11.0 ], "layouttemplate": "Hamilton_County_Portrait", "activedataframesize": [ 7.75, 8.0 ], "layoutoptions": { "hasauthortext": false, "hascopyrighttext": false, "hastitletext": false, "haslegend": false, "customtextelements": [{ "subdiv" : "" }, { "city" : "" }, { "township" : "" }, { "info : "Parcel lists:" }] }
High Quality Printing 3 Tiered Approach : Tier 3 Advanced cases Supported via arcpy.mp Map & layer addition, replacement, etc.
Advanced Print Service Using arcpy Jeff Moulds
Security Print web map containing secured services
Can I Use Secured Services with Printing Service? Secured Services are supported - Short term token (optionally with referrer) Web tier level security supported when server is federated to a portal - e.g. Windows Integrated Authentication
Printing Service how does it work with secured services? ExportWebMap JSON token Web Application Printing Service Output in PDF, PNG etc token token A Secured Service
Web Tier Web Tier mydomain/user1 Printing Service Web Tier Security ExportWebMap JSON Web Application Printing Service ArcGIS Server Account ArcGIS Server Account mydomain/user1 A Secured Service ArcGIS Server Account
Portal mydomain/user1 Printing Service Web Tier Security and Portal ExportWebMap JSON token Web Application Printing Service Output in PDF, PNG etc token mydomain/user1 A Secured Service Portal token
Tips
Printing Cached Services Raster tiles typically created at 96 DPI Dynamic layer support can be enabled for Map Services - Allows for printing at higher DPI than cached images - You must have Publisher or Admin privileges to update the service dynamiclayers = False (600 DPI) dynamiclayers = True (600 DPI)
Enabling Dynamic Layers Option in properties of a cached service
ArcGIS Online Organization & ArcGIS Enterprise Register your own print service Print on-premises services behind a firewall
Layout Templates Location and Register to ArcGIS Server Option #1: when folder is not registered, templates get copied to server Updates to templates require republishing
Layout Templates Location and Register to ArcGIS Server Option #2: in a network shared folder Option #3: Unmanaged folder on the server Update templates without republishing or restarting
Layout Templates Location and Registered Data Stores Option #2: in a network shared folder Option #3: Unmanaged folder on the server
Wait! You didn t actually print anything Printing services are about generating printable documents (PDF etc.) If you wish to send the output to a physical printer automatically - Use the arcpy.mp workflow - Local printers xcopy to local share on some printers - Cloud printing workflows (e.g. Google Cloud Print) - Driverless printing - Simple APIs that can be called from Python
Three Web Map printing development paths Create your web app using the JavaScript API or the Web AppBuilder Simple printing with the out of the box print service. Arcpy.mp custom print service Use the out of the box print service with your own custom layout templates
Advanced web map printing with arcpy.mp Full capabilities of arcpy.mp: - Export using advanced options (e.g. high DPI or embed feature attributes in PDF) - Export map series - Export to PDF and insert additional PDF pages (title page, reports, driving directions, street index, etc.) - Printing pop-ups and feature attributes - Update layout elements (e.g. update a picture) - Swap out cached service layers for staged local vector data for vector PDF output - Etc.
Advanced web map printing with arcpy.mp JavaScript API & Web AppBuilder arcpy.mp. ConvertWebMapToArcGISProject High-quality cartographic output (e.g. PDF) The Print Widget in the web app will use your python script Arcpy.mp method for converting Web Maps to ArcGIS Pro Projects: ConvertWebMapToMapArcGISProject(webmap_json, {template_pagx}, {mapframe_name}, {notes_gdb}) Return a printer-friendly output file (PDF, PNG, etc.) Supports client side graphics in your web app.
Advanced web map printing with arcpy.mp - James Bond Demo Map Series (arcpy.mp.mapseries class new at 2.1) PDF export options: Embed feature attributes Embed georeferencing info Control layer visibility Utilize dynamic layout elements: Extent Indicators Dynamic Grids Dynamic Tables (new at 2.1) Dynamic Text Dynamic Table Attributes (new at 2.2) Dynamic Table Statistics (new at 2.2) Dynamic Charts (new at 2.0)
Get web map JSON Get output format Get layout template ConvertWebMapToArc GISProject Referencing variables Turn off web layers Select by location Export to PDF Output file for job
Advanced web map printing with arcpy.mp Blog post: printing pop-ups - http://esriurl.com/14417
Advanced web map printing with arcpy.mp Printing geodatabase attachments (e.g. pictures)
Advanced web map printing with arcpy.mp help topics Introduction to arcpy.mp - http://esriurl.com/14447 Web map printing with arcpy.mp help topic - http://esriurl.com/14382 (new topic at 2.2) Make a layout tutorial - http://esriurl.com/14457
Please Take Our Survey on the App Download the Esri Events app and find your event Select the session you attended Select the Feedback tab Complete answers and select Submit
See Us Here WORKSHOP ArcGIS Pro: Mapping and Visualization Python: Map Automation in ArcGIS Pro LOCATION Room 01 A/B Room 33 A/B TIME FRAME 4:00 am 5:00 pm 8:30 am 09:30 am