Hello. Does anyone know how to over-ride the print widget Advanced Settings that are set by default? I figured out how to add in the following code in the print.js file located at: <appName>\Widgets\Print\Print.js to change the print height and width, but the default settings still show up.
My Custom Code:
ESRI Default Code:
The default settings are not much bigger than post card settings.
Any help is appreciated
Solved! Go to Solution.
Ian,
In the templates folder open the Print.html and make changes to the width, height and dpi inputs:
i.e. data-dojo-props="name:'dpi',required:true,value:96,style:'width:100px;'"
<div data-dojo-type="dijit/form/Form" data-dojo-attach-point="mapOnlyFormDijit">
<table cellspacing="5">
<tr>
<td>
${nls.width}:
</td>
<td>
<input type="text" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="name:'width',required:true,value:670,style:'width:100px;'"
/>
</td>
</tr>
<tr>
<td>
${nls.height}:
</td>
<td>
<input type="text" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="name:'height',required:true,value:500,style:'width:100px;'"
/>
</td>
</tr>
</table>
</div>
<div style="font-weight:bold;">
${nls.printQualityOptions}:
</div>
<div data-dojo-type="dijit/form/Form" data-dojo-attach-point="mapQualityFormDijit">
<table cellspacing="5">
<tr>
<td>
${nls.dpi}:
</td>
<td>
<input type="text" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="name:'dpi',required:true,value:200,style:'width:100px;'"
/>
</td>
</tr>
</table>
</div>
Ian,
In the templates folder open the Print.html and make changes to the width, height and dpi inputs:
i.e. data-dojo-props="name:'dpi',required:true,value:96,style:'width:100px;'"
<div data-dojo-type="dijit/form/Form" data-dojo-attach-point="mapOnlyFormDijit">
<table cellspacing="5">
<tr>
<td>
${nls.width}:
</td>
<td>
<input type="text" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="name:'width',required:true,value:670,style:'width:100px;'"
/>
</td>
</tr>
<tr>
<td>
${nls.height}:
</td>
<td>
<input type="text" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="name:'height',required:true,value:500,style:'width:100px;'"
/>
</td>
</tr>
</table>
</div>
<div style="font-weight:bold;">
${nls.printQualityOptions}:
</div>
<div data-dojo-type="dijit/form/Form" data-dojo-attach-point="mapQualityFormDijit">
<table cellspacing="5">
<tr>
<td>
${nls.dpi}:
</td>
<td>
<input type="text" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="name:'dpi',required:true,value:200,style:'width:100px;'"
/>
</td>
</tr>
</table>
</div>
Robert,
Perfect! This helped tremendously. I did remove my hard coded line that I posted above since that does override the settings in the Advanced settings. Thank you again for your help!
Hi Ian
where did you find the Print.html ?
Regards
Jürgen
Hi Robert
where did you find the Print.html ?
regards
Jürgen
Jurgen,
In the Web App Builder code, follow these steps:
Refer to the code highlighted in red. This is where you can change the height and width properties. Other parts of the file contain other settings you can change.
Find the following code:
<div data-dojo-type="dijit/form/Form" data-dojo-attach-point="mapOnlyFormDijit">
<table cellspacing="5">
<tr>
<td>
${nls.width}:
</td>
<td>
<input type="text" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="name:'width',required:true,value:1615,style:'width:100px;'"
/>
</td>
</tr>
<tr>
<td>
${nls.height}:
</td>
<td>
<input type="text" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="name:'height',required:true,value:1245,style:'width:100px;'"
/>
</td>
</tr>
</table>
</div>
Hope this helps.
In ArcGIS Portal 10.5 you have to modify also Widget.js and Print.js file located in one of folders:
Search for 'dpi' and find something like in picture below:
Regards,
Kuba