xps

Exporting Large DGML Diagram to XPS

两盒软妹~` 提交于 2020-01-04 04:19:10
问题 I currently have a fairly large application (about 30k lines of code). I generated a dependency graph using the architecture tool within VS2010. I am trying to export it to XPS, as it states I can, and it will stop at about 300KB, and will not open in XPS viewer. Any ideas on why it is stopping the export and corrupting the file, or is it? Thanks! 回答1: You can pass by another structure before converting your diagram to XPS, for example save it as an image, to do it : Right-click the graph

在WPF中实现XPS打印和预览功能

这一生的挚爱 提交于 2020-01-03 04:39:46
XPS是.net中的一个全新的打印架构,它是一个固定布局的描述格式,不仅它是WPF打印输出的基础,而且还可以把它当做独立的文件格式来使用。于是我们在设计WPF的打印功能时首先不得不想到XPS打印。由于在网上关于WPF设计的XPS打印的介绍不多,而且在MSDN上介绍的XPS打印设计也是基于.net硬编码的方式来完成的,对所见即所得的支持不好。于是笔者根据XPS打印API做了一个自己的基于FixedDocument的打印服务。并调用了内置的DocumentViewer的文档显示服务和打印功能。 一、首先看一下WPF中对XPS提供的三种文档的打印服务: 1、 打印固定的文档类,包括FixedPage、FixedDocument、FixedDocumentSequence类,这些类提供了用于提交一个单独的页面、一整个文档或者一个含有若干文件的打印。 2、 打印流式的文档类,主要是FlowDocument类,提供对文档流的打印。 3、 打印可视元素类,主要是Visual及派生类对象,提供对可视树的打印。 二、接下来我们看一下XPS打印的服务的重要的类: 1、 XPSDocument:是一个打印包方面的服务文档类,如装载和保存XPS文档或者添加缩微图等。 public XpsDocument(string path,FileAccess packageAccess) 用默认的隔行扫描

Blank pages when implementing DocumentPaginator

不想你离开。 提交于 2019-12-31 05:42:43
问题 I'm trying to implement a Paginator like this: public class MyPaginator : DocumentPaginator{ // ommitting details... public override DocumentPage GetPage(int pageNumber) { DocumentPage page = new DocumentPage(canvas); return page; } } It compiles, it runs, but the page is blank (white). the 'canvas' is an instance of System.Windows.Controls.Canvas. When I put it in a on-screen container like ScrollViewer it renders perfectly. XpsDocument _xpsDocument = CreateXpsDoc(myPaginatorInstance); The

Blank pages when implementing DocumentPaginator

依然范特西╮ 提交于 2019-12-31 05:42:05
问题 I'm trying to implement a Paginator like this: public class MyPaginator : DocumentPaginator{ // ommitting details... public override DocumentPage GetPage(int pageNumber) { DocumentPage page = new DocumentPage(canvas); return page; } } It compiles, it runs, but the page is blank (white). the 'canvas' is an instance of System.Windows.Controls.Canvas. When I put it in a on-screen container like ScrollViewer it renders perfectly. XpsDocument _xpsDocument = CreateXpsDoc(myPaginatorInstance); The

Silently use Microsoft XPS Document Writer printer to create XPS

陌路散爱 提交于 2019-12-31 03:23:06
问题 For some days now I've been battling with printing XPS to file without the dialog. I've read posts on the matter in CodeGuru and by Feng Yuan (MSDN), along with many discussion topics here and I am still lost. Specifically my scenario is that I have a 3rd party API that I must use, and it prints to the default printer (say Microsoft XPS Document Writer). I want to be able to "apply" a filename prior to the printing procedure, and of course not to have dialog. I've tried working with WinDDK -

Dispatcher xps memory leak

余生颓废 提交于 2019-12-30 13:31:14
问题 I'm call a .net 4.0 dll from a vb6 app using com interop. In .net I create an xps document, via a xaml fixed document and save it to disk. This causes and memory leak and I've found a great solution here. Saving a FixedDocument to an XPS file causes memory leak The solution above, that worked for me, involves this line of code: Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.SystemIdle, new DispatcherOperationCallback(delegate { return null; }), null); What exactly is happening with

Dot Matrix printing in C#?

☆樱花仙子☆ 提交于 2019-12-29 03:12:53
问题 I'm trying to print to Dot Matrix printers (various models) out of C#, currently I'm using Win32 API (you can find alot of examples online) calls to send escape codes directly to the printer out of my C# application. This works great, but... My problem is because I'm generating the escape codes and not relying on the windows print system the printouts can't be sent to any "normal" printers or to things like PDF print drivers. (This is now causing a problem as we're trying to use the

Extract texts from xps document to textbox

十年热恋 提交于 2019-12-25 13:14:11
问题 I keep running in to this code when researching, however copying this to my form gives me an error in the documentViewerElement part saying The name 'documentViewerElement' does not exist in the current context XpsDocument _xpsDocument=new XpsDocument("/path",System.IO.FileAccess.Read); IXpsFixedDocumentSequenceReader fixedDocSeqReader =_xpsDocument.FixedDocumentSequenceReader; IXpsFixedDocumentReader _document = fixedDocSeqReader.FixedDocuments[0]; IXpsFixedPageReader _page = _document

Print documents via Wpf-controls and convert to XPS

邮差的信 提交于 2019-12-24 15:44:00
问题 I'm trying to convert XAML control to XPS document, but i'd like to do this in batch mode - render control in memory and print it to XPS without rendering it on the screen. This project should work even without GUI. I've read Related topic on stackoverflow, but it's not working properly. I can create control, set DataContext, but output xps is empty. If i render control on the screen and then print it, everything is ok, but if i'd like to do this in batch mode, i got empty document (there was

WPF DocumentViewer enable scroll on touch screen for XPS document

核能气质少年 提交于 2019-12-24 12:12:45
问题 When showing an XPS document in the DocumentViewer control of a WPF application it does not allow you to scroll its content on a touch enabled tablet just my moving your fingers over the screen. Instead it selects the text. The only way of scrolling on a touch enabled device is by using the vertical scrollbar. Is there a way to enable touch scrolling by moving your fingers on the content itself instead of on the vertical scrollbar? By overriding some styles I could prevent the text selection