documentviewer

Render PDF using DocumentViewer control?

≡放荡痞女 提交于 2019-11-29 21:32:07
问题 Is it possible to render PDF using DocumentViewer (it's WPF control) ? If it is possible then how ? Code example or link to some code example would be appreciated. Thanks for answers. 回答1: I don't think it is possible with the DocumentViewer - unless you convert to XPS first. There are a few other threads on displaying PDF in WPF: Display a PDF in WPF Application Please suggest a PDF viewer for WPF http://hugeonion.com/2009/04/06/displaying-a-pdf-file-within-a-wpf-application/ http://www

Printing the content of a DocumentViewer in a different UI thread

二次信任 提交于 2019-11-29 04:43:52
In my WPF app, I have particular Window which contains, amongst other controls, a DocumentViewer . When this window is opened and loaded, it dynamically builds a FixedDocument with a progress indicator, and then displays it in the DocumentViewer . It works, and to improve the user experience, I run this window in its own thread, so that the main application window is still responsive while the document is being built. Based on the tips at this web page , I open my window in a new thread like this: public void ShowDocumentViewerWindow(params object[] data) { var thread = new Thread(() => { var

How do you hide a WPF DocumentViewer's menu bars?

谁说胖子不能爱 提交于 2019-11-29 00:12:59
At the moment I have a DocumentViewer in a WPF window that displays an XPS file. I have created my own "Next Page" and "Previous Page" buttons and have set the DocumentViewer.Background property to be completely transparent. All that is left of the DocumentViewer's own controls is the menu bar at the top (displaying zoom settings, print, etc.) and the "Find" bar at the bottom. I would quite like to remove (or hide) both of these bars, but I can't seem to figure out how!? Also, when the document is loaded it defaults to a zoom level that doesn't display the entire page on screen, I need to

Setting PageOrientation for the Wpf DocumentViewer PrintDialog

断了今生、忘了曾经 提交于 2019-11-28 19:33:30
Using the Wpf DocumentViewer control I can't figure out how to set the PageOrientation on the PrintDialog that the DocumentViewer displays when the user clicks the print button. Is there a way to hook into this? mcw0933 Mike's answer works. The way I chose to implement it was to instead create my own doc viewer derived from DocumentViewer. Also, casting the Document property to FixedDocument wasn't working for me - casting to FixedDocumentSequence was. GetDesiredPageOrientation is whatever you need it to be. In my case, I'm inspecting the first page's dimensions, because I generate documents

WPF: How can I remove the searchbox in a DocumentViewer?

☆樱花仙子☆ 提交于 2019-11-28 09:18:19
My XAML code is like this: <Window xmlns ='http://schemas.microsoft.com/netfx/2007/xaml/presentation' xmlns:x ='http://schemas.microsoft.com/winfx/2006/xaml' Title ='Print Preview - More stuff here' Height ='200' Width ='300' WindowStartupLocation ='CenterOwner'> <DocumentViewer Name='dv1' ... /> </Window> How can I, in XAML or in C#, eliminate the search box? Cheeso Vlad's answer led me to look at how to programmatically grab the ContentControl that holds the find toolbar. I didn't really want to write an entirely new template for the DocumentViewer; I wanted to change (hide) only one control

Printing the content of a DocumentViewer in a different UI thread

∥☆過路亽.° 提交于 2019-11-27 22:39:50
问题 In my WPF app, I have particular Window which contains, amongst other controls, a DocumentViewer . When this window is opened and loaded, it dynamically builds a FixedDocument with a progress indicator, and then displays it in the DocumentViewer . It works, and to improve the user experience, I run this window in its own thread, so that the main application window is still responsive while the document is being built. Based on the tips at this web page, I open my window in a new thread like

How do you hide a WPF DocumentViewer's menu bars?

妖精的绣舞 提交于 2019-11-27 15:17:27
问题 At the moment I have a DocumentViewer in a WPF window that displays an XPS file. I have created my own "Next Page" and "Previous Page" buttons and have set the DocumentViewer.Background property to be completely transparent. All that is left of the DocumentViewer's own controls is the menu bar at the top (displaying zoom settings, print, etc.) and the "Find" bar at the bottom. I would quite like to remove (or hide) both of these bars, but I can't seem to figure out how!? Also, when the

Setting PageOrientation for the Wpf DocumentViewer PrintDialog

和自甴很熟 提交于 2019-11-27 12:20:02
问题 Using the Wpf DocumentViewer control I can't figure out how to set the PageOrientation on the PrintDialog that the DocumentViewer displays when the user clicks the print button. Is there a way to hook into this? 回答1: Mike's answer works. The way I chose to implement it was to instead create my own doc viewer derived from DocumentViewer. Also, casting the Document property to FixedDocument wasn't working for me - casting to FixedDocumentSequence was. GetDesiredPageOrientation is whatever you

WPF: How can I remove the searchbox in a DocumentViewer?

江枫思渺然 提交于 2019-11-27 02:15:06
问题 My XAML code is like this: <Window xmlns ='http://schemas.microsoft.com/netfx/2007/xaml/presentation' xmlns:x ='http://schemas.microsoft.com/winfx/2006/xaml' Title ='Print Preview - More stuff here' Height ='200' Width ='300' WindowStartupLocation ='CenterOwner'> <DocumentViewer Name='dv1' ... /> </Window> How can I, in XAML or in C#, eliminate the search box? 回答1: Vlad's answer led me to look at how to programmatically grab the ContentControl that holds the find toolbar. I didn't really want