xps

How to convert a XPS file to an image in high quality (rather than blurry low resolution)?

帅比萌擦擦* 提交于 2019-11-27 13:55:20
问题 I'm trying to convert an XPS with WPF. The idea is that these images can be loaded with silverlight 4, for this I am using the following code: // XPS Document XpsDocument xpsDoc = new XpsDocument(xpsFileName, System.IO.FileAccess.Read); FixedDocumentSequence docSeq = xpsDoc.GetFixedDocumentSequence(); // The number of pages PageCount = docSeq.References[0].GetDocument(false).Pages.Count; DocumentPage sizePage = docSeq.DocumentPaginator.GetPage(0); PageHeight = sizePage.Size.Height; PageWidth

WPF to XPS to PDF

我的未来我决定 提交于 2019-11-27 04:31:01
问题 I have implemented a report in standard WPF controls and have also implemented a DocumentPaginator to take these controls and convert them into a document for printing. I have also implemented some code which uses the document paginator to render the pages to images and write them out to a PDF using PDFSharp, however this does not allow for copying and pasting, also the image quality is questionable. I have experimented with the GhostXPS utility and was thinking of using it by saving out to

How to create an XPS document?

走远了吗. 提交于 2019-11-27 00:46:04
问题 I'd like to create an XPS document for storing and printing. What is the easiest way to create an XPS document (for example with a simple grid with some data inside) in my program, and to pass it around? 回答1: Nothing easy about it. But it can be done. I've got some (sadly, still buggy) sample code and information on my blog for creating the document in memory. Here's some code I whipped up for testing that encapsulates everything (it writes a collection of FixedPages to an XPS document in

Xps printing from windows service

删除回忆录丶 提交于 2019-11-26 22:48:00
问题 I'm trying to print XPS documents from a windows service on the .net framework. Since Microsoft does not support printing by using System.Drawing.Printing nor by using System.Printing (WPF), I'm using the native XPSPrint API. This is suggested to me by Aspose in http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-print-a-document-on-a-server-via-the-xpsprint-api.html. When I try to print an XPS document from a windows service, the result contains strange characters

Convert WPF (XAML) Control to XPS Document

杀马特。学长 韩版系。学妹 提交于 2019-11-26 21:27:14
Can I take an Existing WPF (XAML) Control, databind it and turn it into an XPS document that can be displayed and printed using the WPF XPS Document Viewer? If so, how? If not, how should I be doing ‘reporting’ in WPF using XPS/PDF/etc? Basically I want to take an existing WPF control, databind it to get useful data into it and then make it printable and saveable for the end user. Ideally the document creation would be done in memory and wouldn’t hit the disk unless the user specifically saved the document. Is this feasible? Actually after messing around with heaps of different samples, all of

Opening XPS document in .Net causes a memory leak

◇◆丶佛笑我妖孽 提交于 2019-11-26 18:32:55
问题 The following code snippet illustrates a memory leak when opening XPS files. If you run it and watch the task manager, it will grow and not release memory until the app exits. '****** Console application BEGINS. Module Main Const DefaultTestFilePath As String = "D:\Test.xps" Const DefaultLoopRuns As Integer = 1000 Public Sub Main(ByVal Args As String()) Dim PathToTestXps As String = DefaultTestFilePath Dim NumberOfLoops As Integer = DefaultLoopRuns If (Args.Count >= 1) Then PathToTestXps =

Convert WPF (XAML) Control to XPS Document

社会主义新天地 提交于 2019-11-26 07:56:40
问题 Can I take an Existing WPF (XAML) Control, databind it and turn it into an XPS document that can be displayed and printed using the WPF XPS Document Viewer? If so, how? If not, how should I be doing ‘reporting’ in WPF using XPS/PDF/etc? Basically I want to take an existing WPF control, databind it to get useful data into it and then make it printable and saveable for the end user. Ideally the document creation would be done in memory and wouldn’t hit the disk unless the user specifically