Printing Graphics - Outline Opacity Lost

1284
10
07-12-2013 08:20 AM
DK5
by
New Contributor III
I am trying to print graphics and noticed that my fill opacity prints fine, but the outline opacity always outputs at 1 (100%).  Anyone come across this and have a workaround?  Is this a bug already, or can it be added as such?
0 Kudos
10 Replies
JohnGravois
Frequent Contributor
i remember this bug, but just confirmed that the problem is not appearing in the request below on our 10.1 SP1 sample server. do you have SP1 installed?

example request
(alpha value of 120 for outline ensures that roughly 50% transparency is applied.)
0 Kudos
DK5
by
New Contributor III
We are running 10.1 SP1.  I thought the alpha (per the samples) ranged from 0 to 1.  So I am setting this on a shape as:

layer.graphics.symbol.outline.color.a = 0.2;  //Sample hardcoded value
layer.graphics.setSymbol(layer.graphics.symbol); //Forces redraw the graphic

Output type is jpg and also tried pdf like your sample, but still not working.

Whereas for fill it is working fine with:
layer.graphics.symbol.color.a = 0.2;  //Sample hardcoded value
layer.graphics.setSymbol(layer.graphics.symbol); //Forces redraw the graphic

Also of note is that the above code setting the outline works fine for a polyline, but the same exact code does not for a polygon.
0 Kudos
JohnGravois
Frequent Contributor
alpha value between 0-1 in API is converted in REST request to 0-255.  what happens when you submit my request above to your own ArcGIS Server instance?
0 Kudos
DK5
by
New Contributor III
That does work when requested from our ArcGIS server instance.  Maybe the value is not getting converted correctly from API (version 3.5) to the REST request?
0 Kudos
JohnGravois
Frequent Contributor
were you able to compare and contrast the webmap json passed by your application and see whether it is supplying an inappropriate alpha value?
0 Kudos
DK5
by
New Contributor III
Yes, the web map JSON always contains 255 for the outline opacity.  Here is a sample:

....
"symbol":{"color":[255,0,0,115],"outline":{"color":[255,0,0,255],"width":1.5,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"}}]}}]}}],"exportOptions":{"outputSize":[804,724],"dpi":96}}

Where as the value of a for the polygon outline is correct (ex. 0.1) when the call to the PrintTask.execute is made.
0 Kudos
JohnGravois
Frequent Contributor
it didn't look like this issue has already been logged, so i submitted [NIM093260: Polygon graphic outline transparency/opacity set in application is overridden in print request.] on your behalf.

not sure how crucial it is, but you can certainly consider using esri.setPreRequestCallback() to try and workaround this issue.  check out this forum thread for more info.

sorry for the inconvenience.
0 Kudos
FC_Basson
MVP Regular Contributor
Same problem here - we're also using 10.1 SP1.  With 10.2 already released and NIM093260 not in the list of issues addressed, can we expect a fix in the next patch?
0 Kudos
JohnGravois
Frequent Contributor
@frederick, i wouldn't expect to see this fix in an ArcGIS Server release or Service Pack because the problem is that the JavaScript API itself fails to send the appropriate request.  that being said, I took a look at the status of this issue and you are correct that it has yet to be resolved.
0 Kudos