Select to view content in your preferred language

How to change the DPI setting in the exportwebmap print service

1578
1
Jump to solution
04-16-2013 07:54 AM
ChrisAdams
Esri Contributor
Is it possible to change the DPI setting when printing from the Flex Viewer application using the out of the box ArcGIS Server 10.1 exportwebmap print service? NIM074373 suggests that the viewer will not have this functionality and the API PrintParameters.exportOptions supports a dpi property (default 96). How would this be configured? Is it within the Flex Viewer config files or can it be set up on the server side?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertJones2
Regular Contributor
I think you'll need to edit the ExportWebMapForm.mxml of the Print Widget. Looking at that file it has a layoutOptions component but no exportOptions:

<fx: Declarations>
        <esri:PrintTask id="printTask"
                        executeComplete="printTask_executeCompleteHandler(event)"
                        fault="printTask_faultHandler(event)"
                        getResultDataComplete="printTask_getResultDataCompleteHandler(event)"
                        getServiceInfoComplete="printTask_getServiceInfoCompleteHandler(event)"
                        jobComplete="printTask_jobCompleteHandler(event)"
                        showBusyCursor="true"/>

        <esri:PrintParameters id="printParameters"
                              format="{formatsDDL.selectedItem}"
                              layoutTemplate="{layoutTemplatesDDL.selectedItem}"
                              map="{hostBaseWidget.map}"
                              preserveScale="{scaleCheckbox.selected}">
            <esri:layoutOptions>
                <esri:LayoutOptions id="layoutOptions"/>
            </esri:layoutOptions>
        </esri:PrintParameters>
    </fx: Declarations>

So:

1. add the exportOptions declaration
2. add a drop down box with dpi options to the widget interface
3. add the code to populate exportOptions similar to existing code for layoutOptions i.e.

layoutOptions.title = txtTitle.text;

Build your widget, add to test Flex app and I'd be expecting dpi to be passed across in the request to the printing service.

http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/tasks/supportClasses/ExportOptions....

Alternatively it's not too difficult to pass dpi as a custom parameter from the printing widget to a service based on the advanced printing Python script, and then insert that value into the resolution parameter of the ExportToPdf task:

http://resources.arcgis.com/en/help/main/10.1/index.html#//00s300000027000000

View solution in original post

0 Kudos
1 Reply
RobertJones2
Regular Contributor
I think you'll need to edit the ExportWebMapForm.mxml of the Print Widget. Looking at that file it has a layoutOptions component but no exportOptions:

<fx: Declarations>
        <esri:PrintTask id="printTask"
                        executeComplete="printTask_executeCompleteHandler(event)"
                        fault="printTask_faultHandler(event)"
                        getResultDataComplete="printTask_getResultDataCompleteHandler(event)"
                        getServiceInfoComplete="printTask_getServiceInfoCompleteHandler(event)"
                        jobComplete="printTask_jobCompleteHandler(event)"
                        showBusyCursor="true"/>

        <esri:PrintParameters id="printParameters"
                              format="{formatsDDL.selectedItem}"
                              layoutTemplate="{layoutTemplatesDDL.selectedItem}"
                              map="{hostBaseWidget.map}"
                              preserveScale="{scaleCheckbox.selected}">
            <esri:layoutOptions>
                <esri:LayoutOptions id="layoutOptions"/>
            </esri:layoutOptions>
        </esri:PrintParameters>
    </fx: Declarations>

So:

1. add the exportOptions declaration
2. add a drop down box with dpi options to the widget interface
3. add the code to populate exportOptions similar to existing code for layoutOptions i.e.

layoutOptions.title = txtTitle.text;

Build your widget, add to test Flex app and I'd be expecting dpi to be passed across in the request to the printing service.

http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/tasks/supportClasses/ExportOptions....

Alternatively it's not too difficult to pass dpi as a custom parameter from the printing widget to a service based on the advanced printing Python script, and then insert that value into the resolution parameter of the ExportToPdf task:

http://resources.arcgis.com/en/help/main/10.1/index.html#//00s300000027000000
0 Kudos