xps

display PDF file into WinForms

本小妞迷上赌 提交于 2019-12-05 23:01:41
I am working on a C# .Net Windows application. Here I create report using Infragistics.Documents.Report and export to .pdf & .xps format. Here I want to bringthose 2 files(.pdf & .xps) into WinForms and display. How to bring saved .pdf & .xps file into win forms. Put a web browser control in your form and navigate it to the PDF / XPS file. Providing a PDF Reader is installed on your system it should work great. You can also use: Process.Start("Foo.pdf"); This is equivalent to the user double-clicking on a PDF file and will launch whatever PDF reader is installed on the system. http://blog

Why am I losing my databinding when printing to an XpsDocument?

倖福魔咒の 提交于 2019-12-05 22:49:58
问题 Update! Binding works. The issue is that the XpsDocumentWriter doesn't properly write the first page of the first document of a FixedDocumentSequence. This seems to be an issue encountered by lots of people doing this sort of thing (i.e., five developers worldwide). The solution is slightly odd. I include it as an answer. Okay, its a bit more subtle than the question suggests. I've got a series of FixedPages, each has its DataContext set individually. Each FixedPage also has one or more

WPF printing of multiple pages with preview

折月煮酒 提交于 2019-12-05 13:01:59
The more I read about the subject the less I understand so apologies in advance if the below seems completely off the wall. I have a usercontrol that contains a flowdocument - a view with a corresponding viewmodel. The aim is to send this to a preview window where the user can view the document and also print it. I lifted some code from an example at http://www.eggheadcafe.com/tutorials/aspnet/9cbb4841-8677-49e9-a3a8-46031e699b2e/wpf-printing-and-print-pr.aspx When the below is called Public Shared Sub PrintPreview(owner As Window, data As FormData) Using xpsStream As New MemoryStream() Using

Is there a way to use a ODTTF font file in my WPF app?

别来无恙 提交于 2019-12-05 08:29:14
When an XPS file is created, it subsets and obfuscates the original document's fonts as ODTTF font files, and bundles them in the XPS file (which is just a zip file, so they are easily extracted.) I've extracted one of these ODTTF files, and included it as a Resource in my WPF app. I'm now trying to use it as the FontFamily of a TextBlock. I tried various URI strings to reference the ODTTF font in my XAML, but I can't get it to work at all. (I can get a regular TTF file to work, just not an ODTTF) Is there a way to do this? I've found evidence in a few Google searches that people are managing

What is XPS files and how it is being used

醉酒当歌 提交于 2019-12-05 07:31:23
I have a simple C# .net web application. In that I'm working with XPS files. I have used the following code private void button1_Click(object sender, EventArgs e) { try { string xpsFile = "D:\\Completed-Form.xps"; xpsToBmp(xpsFile); MessageBox.Show("Done"); } catch (Exception ex) { MessageBox.Show (ex.Message); } } static public void xpsToBmp(string xpsFile) { XpsDocument xps = new XpsDocument(xpsFile, System.IO.FileAccess.Read); FixedDocumentSequence sequence = xps.GetFixedDocumentSequence(); for (int pageCount = 0; pageCount < sequence.DocumentPaginator.PageCount; ++pageCount) { DocumentPage

WPF image vector format export (XPS?)

守給你的承諾、 提交于 2019-12-05 00:21:25
问题 Our tool allows export to PNG, which works very nicely. Now, I would like to add export to some vector format. I tried XPS, but the results are not satisfying at all. Take a look at a comparison http://www.jakubmaly.cz/xps-vs-png.png. The picture on the left comes from an XPS export, the picture on the right from PNG export, the XPS picture is visibly blurred when opened in XPS Viewer and zoomed 100%. Are there any settings that I am missing or why is it so? Thanks, Jakub. A sample xps output

Print PDF to XPS using Powershell

天涯浪子 提交于 2019-12-04 16:19:06
I would like to convert a folder containing PDF files into XPS files using Powershell. Due to system restrictions, I am unable to download any third party software like iTextSharp to make this work. I have been able to get Powershell to open the document and open the print window for XPS, but the name is always blank. Is it possible to have the new file name match the original file name? Also, how can the process be automated so user input is not required (ie entering the file name or pressing print)? Lastly, is it possible to change the directory that it prints to? Get-ChildItem -path $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

remove page from fixed document?

╄→гoц情女王★ 提交于 2019-12-04 08:58:34
How can I remove a page from a fixedDocument? I add pages like this: // Add page to pageContent PageContent pageContent = new PageContent(); ((IAddChild)pageContent).AddChild(fixedPage); // Add pageContent to wholeDoc fixedDocument.Pages.Add(pageContent); //Add to documentVeiwer documentViewer1.Document = fixedDocument; But there is no 'fixedDocument.Pages.Remove(page)' method! What can I do? Could you try "cloning" the document into a new document and copy / move all pages over to the new document, except for the one(s) you want to remove? Not sure if that would work or not. I know this is an

WPF image vector format export (XPS?)

 ̄綄美尐妖づ 提交于 2019-12-04 07:57:29
Our tool allows export to PNG, which works very nicely. Now, I would like to add export to some vector format. I tried XPS, but the results are not satisfying at all. Take a look at a comparison http://www.jakubmaly.cz/xps-vs-png.png . The picture on the left comes from an XPS export, the picture on the right from PNG export, the XPS picture is visibly blurred when opened in XPS Viewer and zoomed 100%. Are there any settings that I am missing or why is it so? Thanks, Jakub. A sample xps output can be found here: http://www.jakubmaly.cz/files/a.xps . This is the code that does the XPS export: