Print Widget
This sample demonstrates how to add a Print widget for a 2D MapView. The widget can preserve map scale or map extent in the printout. By default, the map extent is preserved. Use TemplateOptions.scaleEnabled to preserve scale instead. The widget also prints a localized date in the printout.
The Print widget calls the Get Layout Templates Info task on the GPServer to discover possible customTextElements values for each template. When using a custom print service, values found there will be populated in the Print widget under Advanced options. These values can be overwritten in the Print widget UI, or programmatically using Print.templateCustomTextElements.
Note: printing a SceneView is not possible at this time. Instead, see SceneView.takeScreenshot().
About this sample
This GeoBlazor Pro sample, written in Blazor for .NET developers, demonstrates the Print widget from the ArcGIS Maps SDK for JavaScript exposed through GeoBlazor Pro's PrintWidget Razor component. The page loads the Missing Migrants Around the Globe WebMap into a 2D MapView and pins a PrintWidget in the upper-right corner. The PrintWidget panel lets the user pick a layout template, set a title, choose an output file format (PDF, PNG, JPG, and others), toggle whether to preserve map extent or map scale, and access advanced options including localized date insertion and per-template custom text elements discovered from the print GPServer's Get Layout Templates Info task. Clicking Print sends the request to the print service and produces a downloadable file. The sample is intended to demonstrate generating server-side printable exports of a WebMap directly from the browser.