xps

How to Split a String into an Array Of Strings?

人盡茶涼 提交于 2019-12-01 12:10:02
问题 Actually i am reading an xps.file in to my Program. My xps file should be like this I paste the following code List<string> lData = new List<string>(); using (XpsDocument xpsDoc = new XpsDocument(fileName, System.IO.FileAccess.Read)) { FixedDocumentSequence docSeq = xpsDoc.GetFixedDocumentSequence(); Dictionary<string, string> docPageText = new Dictionary<string, string>(); for (int pageNum = 0; pageNum < docSeq.DocumentPaginator.PageCount; pageNum++) { DocumentPage docPage = docSeq

Convert XPS to PDF in WPF C# application

依然范特西╮ 提交于 2019-12-01 10:47:37
I need to convert an XPS file I create with my application to a PDF file, what is the best way to do so? I prefer this to be done from inside C# using a managed assembly. Open source is preferred upon third party solutions You can use the XpsDocument class to read the XPS files, then use a PDF library (such as Report.Net or #PDF) to export it. I used #PDF back in .NET 1.1, but not sure if it can be easily converted to .NET 2.0. #PDF: http://sharppdf.sourceforge.net/ Report.NET: http://report.sourceforge.net/ An open source managed assembly might be hard to find, but you can look at

Convert XPS to PDF in WPF C# application

时光总嘲笑我的痴心妄想 提交于 2019-12-01 09:13:57
问题 I need to convert an XPS file I create with my application to a PDF file, what is the best way to do so? I prefer this to be done from inside C# using a managed assembly. Open source is preferred upon third party solutions 回答1: You can use the XpsDocument class to read the XPS files, then use a PDF library (such as Report.Net or #PDF) to export it. I used #PDF back in .NET 1.1, but not sure if it can be easily converted to .NET 2.0. #PDF: http://sharppdf.sourceforge.net/ Report.NET: http:/

WPF: flowdocument to PDF [closed]

会有一股神秘感。 提交于 2019-11-30 16:12:29
hI, Is there any control that prints flow document content to PDF? EDIT: not a 3rd party control Thank you I was able to solve my problem by saving the flowdocument content to .DOCX and converting it to PDF by using Microsoft.Office.Interop.Word using moiw = Microsoft.Office.Interop.Word; public static void WordToPDF(string docFileName) { // Create a new Microsoft Word application object moiw.Application word = new moiw.Application(); // C# doesn't have optional arguments so we'll need a dummy value object oMissing = Missing.Value; // Get a Word file FileInfo wordFile = new FileInfo

Can multiple xps documents be merged to one in WPF?

有些话、适合烂在心里 提交于 2019-11-30 06:02:43
问题 Can multiple xps documents be merged to one xps document in WPF and shown in DocumentViewer ? An application has 4 small xps documents each displayed seperately, but in one of the places all 4 documents should be shown as one document. How do I go about it? 回答1: Here, targetDocument is the target path of the new file and list is a list of all documents to be merged. public void CreateXPSStreamPages(string targetDocument, List<string> list) { Package container = Package.Open(targetDocument,

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

xps转换为pdf

家住魔仙堡 提交于 2019-11-29 19:07:46
https://www.cnblogs.com/zeoy/archive/2013/01/09/2852941.html https://blog.csdn.net/jafucong/article/details/78980276 PdfDocument doc = new PdfDocument(); doc.LoadFromFile(xpsFile,FileFormat.XPS); doc.SaveToFile(pdfFile, FileFormat.PDF); 来源: https://www.cnblogs.com/changbaishan/p/11527529.html

Extract text from a XPS Document [closed]

偶尔善良 提交于 2019-11-29 18:10:53
i need to extract the text of a specific page from a XPS document. The extracted text should be written in a string. I need this to read out the extracted text using Microsofts SpeechLib. Please examples only in C#. Thanks Sanjay Add References to ReachFramework and WindowsBase and the following using statement: using System.Windows.Xps.Packaging; Then use this code: XpsDocument _xpsDocument=new XpsDocument("/path",System.IO.FileAccess.Read); IXpsFixedDocumentSequenceReader fixedDocSeqReader =_xpsDocument.FixedDocumentSequenceReader; IXpsFixedDocumentReader _document = fixedDocSeqReader

How Can I Check That A File Is A Valid XPS File With C#?

痞子三分冷 提交于 2019-11-29 16:40:21
I have a WinForms application that processes XPS files. How can I check that the file the user has selected in the open dialog is a valid XPS file using C#? There WILL be files present with the .XPS extension that are not really XPS files. Since XPS files are really in the PKZIP format, I could check for the PKZIP byte signature but that would give false positives on ZIP archives. The following will distinguish XPS files from other ZIP archives and non-ZIP files. It won't determine whether the file is fully-valid XPS - for that you would need to load each page. using System; using System.IO;

“The calling thread must be STA, because many UI components require this.” Error in WPF?

廉价感情. 提交于 2019-11-29 02:40:42
I am creating a xps document as below. Assembly assembly = Assembly.GetExecutingAssembly(); //read embedded xpsDocument file Stream helpStream = assembly.GetManifestResourceStream(resourceNameOfContext); if (helpStream != null) { Package package = Package.Open(helpStream); string inMemoryPackageName = "memorystream://" + topicName + ".xps"; Uri packageUri = new Uri(inMemoryPackageName); //Add package to PackageStore PackageStore.AddPackage(packageUri, package); docXps = new XpsDocument(package, CompressionOption.Maximum, inMemoryPackageName); } return docXps; When i am trying to get docXps