

- Install microsoft xps document writer windows 8 how to#
- Install microsoft xps document writer windows 8 windows 8#
XpsFont font = pageWriter.AddFont( false) Private static string AddFont( IXpsFixedPageWriter pageWriter, String fontSource) Stream srcImageStream = new FileStream(imageSource, FileMode.Open) ĬopyStream(srcImageStream, dstImageStream) Stream dstImageStream = image.GetStream() XpsImage image = pageWriter.AddImage( XpsImageType.JpegImageType) Private static string AddImage( IXpsFixedPageWriter pageWriter, String imageSource)

XmlWriter xmlWriter = pageWriter.XmlWriter PageContents = pageContents.Replace( "image3", image3Uri) PageContents = pageContents.Replace( "image2", image2Uri) PageContents = pageContents.Replace( "image1", image1Uri) PageContents = pageContents.Replace( "font1", font1Uri) String pageContents = srcTextStream.ReadToEnd() StreamReader srcTextStream = new StreamReader(srcPage)

Load Markup file, and replace tokens with actual Xps URIs String font1Uri = AddFont(pageWriter, font1Path) String image3Uri = AddImage(pageWriter, image3Path) String image2Uri = AddImage(pageWriter, image2Path) String image1Uri = AddImage(pageWriter, image1Path) String font1Path = Directory.GetCurrentDirectory() + "\\Fonts\\CURLZ_.TTF" String image3Path = Directory.GetCurrentDirectory() + "\\Images\\Tower of London.jpg" String image2Path = Directory.GetCurrentDirectory() + "\\Images\\Paris Notre Dame.jpg" String image1Path = Directory.GetCurrentDirectory() + "\\Images\\Amsterdam Canal.jpg" IXpsFixedPageWriter pageWriter = docWriter.AddFixedPage() IXpsFixedDocumentWriter docWriter = docSeqWriter.AddFixedDocument() IXpsFixedDocumentSequenceWriter docSeqWriter = XpsDocument document = new XpsDocument(dstContainer, FileAccess.ReadWrite)
Install microsoft xps document writer windows 8 how to#
The code below demonstrates how to add images and fonts to an XPS Document. I have edited the code slightly let me know if you have any questions. There is a good sample that clearly demonstrates this in the January CTP Hands on labs PRSHOL11 - Programming XPS Documents, which can be downloaded here ( ) function, so nothing is lost, just the choices switched.You can use the IXpsFixedPageWriter API to programmatically add images and other resources to your XpsDocument. You can of course still save files as *.oxps using the Save as.
Install microsoft xps document writer windows 8 windows 8#
From now on, the Microsoft XPS Document Writer in your Windows 8 saves the documents in the original XPS document by default. With the Local Group Policy Editor launched, browse to the " Local Computer Policy\Computer Configuration\Administrative Templates\Printers " folder and select the " Change Microsoft XPS Document Writer (MXDW) default output format to the legacy Microsoft XPS format (*.xps)" item.īy default, this group policy is not configured, but can be easily enabled.Īfter saving the changes, you will likely have to relog to your Window so the new settings are loaded.Īnd that's it. The item you are looking for is called " Edit group policy".Ģ. If you are not sure where it is located, simply type it in your Metro search box and locate in the settings category. first find the Group Policy control panel to change the settings. It requires you to change a specific Group Policy.ġ. There is also a way how to select the XPS format as default choice in Windows 8 for the Microsoft XPS Document Writer. window Changing the Microsoft XPS Document Writer default format in Windows 8 function, in which you can pick what format to use. You can manually select in which format the XPS Writer saves your document using the File - Save as. Manually selecting XPS format instead OXPS
