How do I resolve Acrobat color inconsistency when using opacity on some graphical elements

Q: I think I'm having an issue related to color spaces in conjunction
with opacity. After stamping text on a page the color shades are
different (darker) on the target document (when viewed in Acrobat -
the colors look ok in other PDF viewers including PDFNet). If I
comment out the following lines of code the color shades remain the
same. I believe I\'m doing the same thing as being done by your sample
code (which works). Attached is a zip file containing the source and
target documents. What could account for this?

GState gstate = element.GetGState();
gstate.SetTextRenderMode(text.m_eRenderingMode);
gstate.SetFillColorSpace(ColorSpace.CreateDeviceRGB());
gstate.SetFillColor(text.m_colorFill);
gstate.SetStrokeColorSpace(ColorSpace.CreateDeviceRGB());
gstate.SetStrokeColor(text.m_colorStroke);
gstate.SetFillOpacity(text.GetFillOpacity());
gstate.SetStrokeOpacity(text.GetStrokeOpacity());
---------
A: It seems that Acrobat is using different color management when
there is some transparency on the page, which results in weird color
shifts. What we wound is that if you explicitly specify page group
dictionary you will get consistent behavior. For example:

Obj g = page.GetSDFObj().PutDict("Group");
g.PutName("CS","DeviceRGB");
g.PutBool("I",false);
g.PutBool("K",false);
g.PutName("S","Transparency");
g.PutName("Type","Group");

You can add this info either before or after adding content to the
page.