Since Silverlight is a small subset it doesn't support all the XAML properties covered by XPS.
I have come across only two elements so far, that have limitations (as explained below). There may be more when trying to convert XPS created by PPT.
My approach, all done in a c# plugin to my application (not PPT):
1) Print the doc using 'Microsoft XPS Printer'. Check if the paper setting of the XPS driver matches the document size you are printing. This could be done manually by the user through ControlPanel. In my case, I try to set it in my c# code itself.
2) For each page, extract the XAML content (XPS .net libraries makes this very easy)
3) Use XMLDOM libraries, extract children of <FixedPage> top level element and warp them in a <Canvas> object
4) Copy images and fonts (thanks to support for obfusticated Font in SL 1.0beta) to appro library and fix their path in the extracted XAML (ImageBrush and Glyph elements).
5) Fix <ImageBrush> tags by removing ViewBox and ViewPort etc, attributes (not supported in Silverlight). You will have to crop the images using the XPS's viewbox/viewport values
appropriately.
6) Remove 'RegionRenderOptions' attribute from Canvas if any (not supported in Silverlight)
And now, you should have XAML that can be passed on to Silverlight.
If you do try this, please share any other elements/attributes you come across that are not supported in Silverlight.
mdhandapai
Member
32 Points
23 Posts
Re: Any chance to convert ppt to silverlight?
Jun 15, 2007 02:07 PM | LINK
App --> XPS --> Silverlight XAML
Since Silverlight is a small subset it doesn't support all the XAML properties covered by XPS.
I have come across only two elements so far, that have limitations (as explained below). There may be more when trying to convert XPS created by PPT.
My approach, all done in a c# plugin to my application (not PPT):
1) Print the doc using 'Microsoft XPS Printer'. Check if the paper setting of the XPS driver matches the document size you are printing. This could be done manually by the user through ControlPanel. In my case, I try to set it in my c# code itself.
2) For each page, extract the XAML content (XPS .net libraries makes this very easy)
3) Use XMLDOM libraries, extract children of <FixedPage> top level element and warp them in a <Canvas> object
4) Copy images and fonts (thanks to support for obfusticated Font in SL 1.0beta) to appro library and fix their path in the extracted XAML (ImageBrush and Glyph elements).
5) Fix <ImageBrush> tags by removing ViewBox and ViewPort etc, attributes (not supported in Silverlight). You will have to crop the images using the XPS's viewbox/viewport values appropriately.
6) Remove 'RegionRenderOptions' attribute from Canvas if any (not supported in Silverlight)
And now, you should have XAML that can be passed on to Silverlight.
If you do try this, please share any other elements/attributes you come across that are not supported in Silverlight.
Good Luck.