JEllenden wrote:
There appear to be two bugs in the code for the XPS to PDF converter when including images.
The first is that when the image brush is created from the page resources, the opacity defaults to 0.0. If the image brush has no explicit opacity defined it ends up transparent. I've fixed this by a quick and dirty hack! In the method PdfSharp.Xps.Parsing.XpsParser.ParseImageBrush immediately after the brush is created add the line:
brush.Opacity = 1;
The second is that the boundary condition for drawing the brush is incorrect. In method PdfSharp.Xps.Rendering.PdfContentWriter find the section where the ImageBrush case is handled. It sets the opacity by multiplying the opacity of the path by the opacity of the brush. It then performs a bounds check - if (opacity < 1). However, this means that if both the opacity of the path and the brush are 1 the Alpha values on the state aren't set. The bounds check should be if (opacity <= 1).
These two changes make it work for me. Hope it sorts you out too.
JEllenden! I have registered here to say thank you to share the solution of this issue. I was about to be crazy... I supposed that the problem was by the adobe reader.