xps-generation

Extract a single page from an XPS document

落爺英雄遲暮 提交于 2020-02-01 05:46:47
问题 I need to split an existing XPS Document and create a new XPS Document with only one page of the original one. I tried to copy the document and delete pages from the copied document, but that's very slow. Is there a more efficient way to do this? In C# please. Thanks. Resolved: public void Split(string originalDocument, string detinationDocument) { using (Package package = Package.Open(originalDocument, FileMode.Open, FileAccess.Read)) { using (Package packageDest = Package.Open

Appending an XPS document to an existing one

一曲冷凌霜 提交于 2019-12-08 05:16:12
问题 Guys, here's where I am stuck. I have a need to create a single XPS file from a huge bunch of tiny XPS files. The problem is that I keep running out of memory when I try to do this. I present below the code (taken from MSDN), but essentially all it does is this: It reads each tiny XPS file Extracts the pages from it. Adds these pages to a FixedDocumentSequence. When all docs are done, it writes this sequence out to the combined XPS doc. IMO, my FixedDocumentSequence is getting too big. So, I

Appending an XPS document to an existing one

我与影子孤独终老i 提交于 2019-12-06 15:30:48
Guys, here's where I am stuck. I have a need to create a single XPS file from a huge bunch of tiny XPS files. The problem is that I keep running out of memory when I try to do this. I present below the code (taken from MSDN), but essentially all it does is this: It reads each tiny XPS file Extracts the pages from it. Adds these pages to a FixedDocumentSequence. When all docs are done, it writes this sequence out to the combined XPS doc. IMO, my FixedDocumentSequence is getting too big. So, I am thinking, that maybe I can do this piece by piece - i.e. append the tiny XPS docs to the combined

Custom page size output in XPS from WPF report

荒凉一梦 提交于 2019-12-05 07:26:29
问题 I have a WPF report which draws the report content in a custom page size (we can consider it as a A4, the problem is the same), if I send the output to a printer (physical or virtual like PDFCreator) my custom page size are correctly preserved for each page. But when I output it as XPS format the pages are adapted to Letter page size. How to preserve my custom page size when outputting a WPF report to XPS ? MY FINAL GOAL: Is to have a PDF from WPF, and my approach is to convert a XPS to PDF

Extract a single page from an XPS document

依然范特西╮ 提交于 2019-12-04 16:03:39
I need to split an existing XPS Document and create a new XPS Document with only one page of the original one. I tried to copy the document and delete pages from the copied document, but that's very slow. Is there a more efficient way to do this? In C# please. Thanks. Resolved: public void Split(string originalDocument, string detinationDocument) { using (Package package = Package.Open(originalDocument, FileMode.Open, FileAccess.Read)) { using (Package packageDest = Package.Open(detinationDocument)) { string inMemoryPackageName = "memorystream://miXps.xps"; Uri packageUri = new Uri

Custom page size output in XPS from WPF report

∥☆過路亽.° 提交于 2019-12-03 22:22:58
I have a WPF report which draws the report content in a custom page size (we can consider it as a A4, the problem is the same), if I send the output to a printer (physical or virtual like PDFCreator) my custom page size are correctly preserved for each page. But when I output it as XPS format the pages are adapted to Letter page size. How to preserve my custom page size when outputting a WPF report to XPS ? MY FINAL GOAL: Is to have a PDF from WPF, and my approach is to convert a XPS to PDF using PDFSharper. The conversion works well but the XPS output corrupts my custom page size. Others

Best ways to convert XPS to PDF (and vice-versa)?

雨燕双飞 提交于 2019-11-30 03:30:50
I have XPS documents being generated from XAML User Controls that act as templates. I want to convert the XPS documents into alternative formats, mainly PDF, programmatically with a .NET based API. What is the best way to do this? You can also use ABCpdf PDF Component for .NET . Version 7 can serve your purpose. see http://www.websupergoo.com/abcpdf-12.htm . it provides fully functional trial version unlike NiXPS and almost equally as fast as NiXPS. The way I have done this in the past is print my XPS file to a PDF printer. I use cutePDF for this. So when you select to print, you print to