Is there a way to print 4.0 MapView ?

3938
5
Jump to solution
05-16-2016 08:31 AM
RobinChappatte
New Contributor III

(Please excuse my english)

In the 3.16 API version, it was possible to print a map: Print | ArcGIS API for JavaScript

Is there a way to do the same thing with the 4.0 API version ?

Or (if not), is it planned to exist in a further version ?

Or is there a "known hack" to render a portion of HTML page (the map) in image format / pdf ?

Thank you in advence for your answers !

Robin Chappatte

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
SteveCole
Frequent Contributor

The functionality matrix says that it's "coming soon" like the dozens of other things missing from the initial release.

View solution in original post

5 Replies
SteveCole
Frequent Contributor

The functionality matrix says that it's "coming soon" like the dozens of other things missing from the initial release.

RobinChappatte
New Contributor III

I didn't saw it, thanks.

By waiting the feature to be out, I can open a new tab, display the map full-page and call window.print(); but that's usable in a few case only (not when I have to get a map image-rendering for not-printing usage).

Is there any other way to render a map ?

0 Kudos
SteveCole
Frequent Contributor

Obviously, using the API will yield the best and "truest" result. If you must use the 4.0 API, I think you're only other option to pursue will be the HTML 5 concept of canvas printing. You'll also find some discussion of this topic here in this forum but it's hit or miss depending on what you have on your map (graphics and labels seem to be the most difficult elements for it to capture).

I haven't messed with canvas printing, though.

RobinChappatte
New Contributor III

Thank you for your answers, I tried to print a page with only a map with the size of a A4 sheet and it work just fine, I now need to find a way to clone / copy a map from a normal page (with other elements that the map) to an empty page, I'll open a new thread for that (Is there a way to clone / copy a map (all layers included) ? ).

0 Kudos
FC_Basson
MVP Regular Contributor

You can build a custom JSON Web Map string following the specifications in the REST API (Export Map (Operation) ) and send it to the Print Service with a normal POST/GET request.  You will have to iterate through all the visible layers to  specify the operational layers in the output map, write any geometries with their symbology, specify the layout options etc., but it can be done.  Here is some more documentation to show you the way: Export Web Map Specification

0 Kudos