Select to view content in your preferred language

Custom PRINT TEMPLATE

1379
14
02-17-2024 12:20 PM
HariomPandya
Occasional Contributor

can ANYONE help me in the custom print experience builder widget  . print preview is not showing for my custom print select , if i change it to map only or any other like a-4 portrait  it is working . 
i want to have print preview for my custom print service custom template  . please help me in this .

14 Replies
ShengdiZhang
Esri Regular Contributor

Hi @HariomPandya ,

I wonder if you selected a different wkid for the print template. Currently, the Preview print extents does not support certain wkid.

Or can you share your app with me so that I can take a look at it? My username is she10946.

Thanks,

Shengdi

0 Kudos
HariomPandya
Occasional Contributor

Hi @ShengdiZhang , Actually when i debug the code for print widget for my custom layout the selected template is not having exportOptions{"Width","height" } also not getting maframeSize[0], and mapFrameSize[1]

0 Kudos
ShengdiZhang
Esri Regular Contributor

Hi, the print widget calculates the printing extent based on the "webMapFrameSize" stored in the Get Layout Templates Info Task.

Please check if you have "Get Layout Template Information Task" in your print service.

ShengdiZhang_0-1708581366988.png

Another place to check is to open the Get Layout Templates Info Task - Execute Task - Execute Task (GET), to see if the list of values contains all custom layouts::

ShengdiZhang_1-1708582211180.png

Shengdi

0 Kudos
HariomPandya
Occasional Contributor

Hi @ShengdiZhang  , thanks for your response . i have added the get layout info task .from the arcgis pro and in arcgis pro it is showing all the values .

HariomPandya_1-1708607406378.png

 

HariomPandya_0-1708606771112.png

But in the rest sevice . what parameters should i pass to check and get the result i am confuswed in json

HariomPandya_2-1708607439364.pngHariomPandya_3-1708607470047.png

IT is showing this . 

0 Kudos
HariomPandya
Occasional Contributor

HI @ShengdiZhang , i am missing something . i am not getting while publishing . in the export webmap i kept webmap as json "#" and layout item as blank . please help where i am lacking .

0 Kudos
ShengdiZhang
Esri Regular Contributor

Hi, if you want to test the Get Layout Templates Info task, you can simply click the Submit Job (GET).

If you want to test the Export Web Map, you can leave the layout template empty to use the default layout, but should not leave the web map JSON as "#".

Below is an example of a Web Map JSON for an empty map:

{"operationalLayers":[{"layerType":"ArcGISTiledMapServiceLayer","url":"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer","id":"World_Hillshade_1081","title":"World_Hillshade","opacity":1,"minScale":0,"maxScale":0},{"type":"VectorTileLayer","styleUrl":"https://www.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json","id":"VectorTile_5394","title":"World Topographic Map","opacity":1,"minScale":0,"maxScale":0}],"mapOptions":{"extent":{"spatialReference":{"wkid":102100},"xmin":-18710885.945394468,"ymin":-2610763.50030847,"xmax":-2489114.0546055334,"ymax":11810763.500308469},"spatialReference":{"wkid":102100},"showAttribution":false},"exportOptions":{"dpi":96},"layoutOptions":{"titleText":"ArcGIS Web Map","customTextElements":[{"Date":"2/23/2024, 2:28:15 PM"}],"elementOverrides":{"North Arrow":{"name":"North Arrow","type":"CIMMarkerNorthArrow","visible":false}},"scaleBarOptions":{"metricUnit":"esriKilometers","metricLabel":"km","nonMetricUnit":"esriMiles","nonMetricLabel":"mi"},"legendOptions":{"operationalLayers":[]}}}

 

 

0 Kudos
HariomPandya
Occasional Contributor

I checked . results are coming , i think i am facing issue while publishing 

 

0 Kudos
HariomPandya
Occasional Contributor

@ShengdiZhang , i think ,  i am doing mistake while publishing via arcgis pro. In the layout item id what should i pass , for both export webmap and second is get layout info task .
I have a folder inside which all the layouts are there . now i opened one layout . after that from arcgis pro .i opened the export webmap tool , provide the layout item folder wherea all layouts are there , now i publish now i used get layout info , pass the same folder it shows json with all layout properties .
now i share both tool from there . still not working ,


in the layout_iteM_id what should i pass ?

0 Kudos
ShengdiZhang
Esri Regular Contributor

Hi, usually the Layout Item ID should be empty as this will set a default value for the layout task. If the default value is not set, passing in an empty layout item ID will return information for all layouts. However, if the default value is set, passing in an empty Layout Item ID will only return information for that layout.

ShengdiZhang_1-1708673191288.png

 

Can you try setting the Layout Item ID to null in both tasks and then publishing the service again to see if that fixes the bug?

If that still doesn't solve the problem, you can send me the print service, the preview extents have a lot of parts to do with it, and without the service, it's hard to find the real problem.

Shengdi

0 Kudos