Select to view content in your preferred language

FV 3 advanced print widget output quality

2983
14
Jump to solution
11-13-2012 01:12 PM
RhettZufelt
MVP Notable Contributor
Hi all,

using the ExportWebMaptask function of the new print widget.  Much nicer than the old one, but wondering if there is some way to make the image quality better?

I see the task has options to set the dpi and image size:
"exportOptions": {  "dpi" : 300,  "outputSize" :  [   500,   500  ] }


But, is there a way to modify the JSON string being sent to the task to overcome the default 96 dpi setting?

Thanks again,

R_
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DasaPaddock
Esri Regular Contributor
You can update ExportWebMapForm.mxml to set the DPI by setting the exportOptions property on the PrintParameters.

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

e.g.

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

View solution in original post

0 Kudos
14 Replies
RhettZufelt
MVP Notable Contributor
Any ideas?

Seems that since it takes the export options as input, one should be able to "modify" it or change that setting.  In fact, seems that this should be a printwidget.xml config option.

deault 96 dpi is  decent for a monitor, but way sub-par for most print jobs.  Seems that 266 should be the default as not many printers have a linefeed of more than 133 and would maximize most printer capabilties.

If nothing else, anyone know where the JSON string for the printTask is being generated?

R_
0 Kudos
BjornSvensson
Esri Regular Contributor
... new print widget.  Much nicer than the old one, but wondering if there is some way to make the image quality better?


Could you show an example? 
What layers are you printing? 
If using image data, what image format are you using (does changing it to use png32 improve it)?
0 Kudos
BrianOevermann
Frequent Contributor
Bjorn,

I, too, have users screaming for better print resolution. I have attached a sample that illustrates what I believe Rhett is also experiencing. I have attempted to add the dpi setting from exportOptions to the widget but have been unsuccessful so far.  I have a feeling that I am inserting the dpi setting in the wrong place within the ExportWebMapForm.mxml

Could you point Rhett, I, and probably many others in the right direction?
0 Kudos
DasaPaddock
Esri Regular Contributor
You can update ExportWebMapForm.mxml to set the DPI by setting the exportOptions property on the PrintParameters.

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

e.g.

        <esri:PrintParameters id="printParameters"                               format="{formatsDDL.selectedItem}"                               layoutTemplate="{layoutTemplatesDDL.selectedItem}"                               map="{hostBaseWidget.map}"                               preserveScale="{scaleCheckbox.selected}">             <esri:exportOptions>                 <esri:ExportOptions dpi="300"/>             </esri:exportOptions>             <esri:layoutOptions>                 <esri:LayoutOptions id="layoutOptions"/>             </esri:layoutOptions>         </esri:PrintParameters>
0 Kudos
RhettZufelt
MVP Notable Contributor
Thanks Dasa,

Sorry I didn't get examples posted, been pretty hectic around here.

Maybe it's just an issue if you live in Washington 😮

R_
0 Kudos
JasonStanton__GISP
Regular Contributor
Dasa,

Thank you so much for your solution!  How would we be able to pick from a (short) drop-down list of options rather than set the DPI for the default?  I'm not a developer so I can 'tinker' with things, but this is WAY beyond my knowledge.

Any assistance would be greatly appreciated!!
0 Kudos
BrianOevermann
Frequent Contributor
Thank you, Dasa.

It turns out that I had the right location, and even the right line of code after all.  I just failed to wrap it in the <esri:exportOptions>... </esri:exportOptions> wrapper.  Doh!  I guess I wrongly assumed that I didn't need to wrap it since it was only one parameter.


JStanton's idea for a pick list of dpi values (or just an input box for entering a value) is something that could be useful in certain situations, though I don't have an immediate need (nor time) to look into it.  If it is an easy "add", I would love to see it.  If it is more complex (and I suspect it may be), this could be a great, "quick enhancement" to the next version of the print widget.  I would also make a pitch to have a dpi (or dpi pick list) added to the config file for the "non-developers" out there.  Just a thought.

Thanks again for the quick solution, Dasa.

@Rhett:  Maybe all of the rain is short-circuiting our code here in Washington! Ha!
0 Kudos
RhettZufelt
MVP Notable Contributor
So I added this to the ExportWebMapForm.mxml

   <esri:exportOptions>
    <esri:ExportOptions dpi="{dpiDD.selectedItem}"/>
   </esri:exportOptions>


also added this:

 <mx:FormItem id="printDPI"
     label="Select DPI"
     width="100%"
     includeInLayout="true"
     visible="true">
  <s:DropDownList id="dpiDD" width="100"
    labelField="dpi"
    selectedIndex="0">
   <s:ArrayList>
    <fx:Object dpi="96"/>
    <fx:Object dpi="266"/>
    <fx:Object dpi="300"/>
   </s:ArrayList>
  </s:DropDownList>
 </mx:FormItem>


This puts the dropdown list for dpi on the print screen and executes with no errors.  However, the new dpi value is not being passed as a parameter.  Anyone know what I am doing wrong and how to make it pass this value as a parameter?

Thanks,

R_
0 Kudos
DasaPaddock
Esri Regular Contributor
Try:

<esri:ExportOptions dpi="{dpiDD.selectedItem.dpi}"/>
0 Kudos