Create Print Preview in JavaScript API 4.x

963
1
05-12-2021 03:46 PM
SurendranNeelakantan
New Contributor III

 

In ESRI Javascript 3x version I have created a print preview to highlight the print area on the screen. User  will get an idea about the area included in the print output. I  used screenUtils API (3.x) for this purpose. While checking the functionality matrix I understand this is deprecated in the 4.x version and not planned to upgrade. The guidelines suggest to use MapView.toMap(), MapView.toScreen(), SceneView.toMap(), SceneView.toScreen(). attached a screen shot from the current 3.x version. Could some one suggest a working example using Javascript API 4.x to get similar output. a sandbox example would be really helpful

printpreview.PNG

1 Reply
Noah-Sager
Esri Regular Contributor

Hi @SurendranNeelakantan, thanks for the question. We have this sample in the SDK that sounds like what you're looking for (and has a sandbox mode):

https://developers.arcgis.com/javascript/latest/sample-code/sceneview-screenshot/

And here is a blog that has some really good tips and tricks about working with Screenshots:

https://community.esri.com/t5/arcgis-configurable-apps-blogs/screenshots-with-the-arcgis-api-for-jav...

 

0 Kudos