During my development last week I was working on a Silverlight based XPS viewer. During this viewer we came to a situation in which an XPS was made from power point slide. In that PPT two images were shown during rendering the images present in it.
The problem is that Silverlight doesn’t have any viewport or viewbox support. Along with these problems, the font files need to be downloaded externally so that we can render them in our XPS Viewer
Using the code
Now i have replace path into Image element, remove 1st image and change left and top to 2nd image plus increase hight.
var viewbox = new Rect(Convert.ToDouble(tempviewbox), Convert.ToDouble(tempviewbox),
var viewport = new Rect(Convert.ToDouble(tempviewPort), Convert.ToDouble(tempviewPort),
Image img = new Image();
img.Source = bitmapImage;
img.Stretch = Stretch.Fill;
img.Height = viewport.Height + Convert.ToDouble(vp);
var parent = path.Parent as Canvas;
var index = parent.Children.IndexOf(path);
var stream = Application.GetResourceStream(_streamResourceInfo, ConvertPartName(glyphs.FontUri.ToString())).Stream;
glyphs.FontSource = new FontSource(stream);