documentviewer

How to show a flow document using a DocumentViewer?

坚强是说给别人听的谎言 提交于 2021-02-07 09:32:33
问题 I have a simple flow document in my resources, FlowDocument1.xaml : <FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ColumnWidth="400" FontSize="14" FontFamily="Georgia"> <Paragraph> Test </Paragraph> </FlowDocument> And I want to show this document in a DocumentViewer . I searched for a property that takes path but I couldn't find one. And the following throws an exception: <DocumentViewer x:Name="TestViewer" Document="Resources/FlowDocument1.xaml" /> How can I

How to show a flow document using a DocumentViewer?

纵饮孤独 提交于 2021-02-07 09:32:05
问题 I have a simple flow document in my resources, FlowDocument1.xaml : <FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ColumnWidth="400" FontSize="14" FontFamily="Georgia"> <Paragraph> Test </Paragraph> </FlowDocument> And I want to show this document in a DocumentViewer . I searched for a property that takes path but I couldn't find one. And the following throws an exception: <DocumentViewer x:Name="TestViewer" Document="Resources/FlowDocument1.xaml" /> How can I

WPF DocumentViewer override Print button

喜夏-厌秋 提交于 2020-05-10 14:57:33
问题 I have implemented print preview functionality within my application using a custom DocumentViewer (shown below). I call PrintDialog.ShowDialog() before showing the preview so as to correctly create the document based on paper orientation. The DocumentViewer print button however calls the PrintDialog.ShowDialog() prompting the user to chose printer and options once again (which they already did prior to the preview window opening). Is there a way to have the DocumentViewer print button simply

Tooltip on scrollviewer in documentviewer

删除回忆录丶 提交于 2020-01-23 16:56:48
问题 I have a documentviewer which i used in my wpf project to show xps document reports of having around 600 pages which is working great. But from user point of view i like to show the current page number as a tooltip on my scrollviewer while dragging the scroll stating the current page number in view. Somewhat like in a PDF file like this - I was looking out for some ideas how to implement this. Just a current page number if not possible to show a thumbnail image would be good enough for me. Is

Tooltip on scrollviewer in documentviewer in case of deferred scrolling

南笙酒味 提交于 2020-01-23 09:45:09
问题 I want to show the tooltip on my scrollviewer on page scrolling which shows the current page number in it which i asked here- Tooltip on scrollviewer in documentviewer. I have implemented the answer after making some changes in the proposed solution but i face some problem. If i write this in my scroll_changed event if (Mouse.LeftButton == MouseButtonState.Pressed) it works perfectly fine but if i have a deferred scrolling enabled on my custom document viewer, the popup(tooltip) never appears

Highlight all hits in documentviewer

耗尽温柔 提交于 2020-01-23 02:44:05
问题 I know that the wpf-documentviewer supports the searching in the documents, if the document is a xpsdocument. The search only highlights one hit after the other. Is it possible to highlight all hits through the search-box? I have the following code to create and set the document of a DocumentViewer-Control: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); FixedDocument fixedDocument = CreateTestDocument(); this.documentViewer.Document =

Displaying Print Preview of HTML Document without DocumentViewer

浪子不回头ぞ 提交于 2020-01-01 03:33:19
问题 I have a C#/WPF application in which I need to display a print preview for an HTML document -- essentially just like what one would see if looking at a print preview in Firefox or even IE. I know about DocumentViewer, however, I am trying to stay away from using a DocumentViewer control as it seems to be pretty slow and some of the documents I need to display can be upwards of 450+ pages and I want to load the preview as quickly as possible. Does anyone know of an elegant way of doing

Flash document viewer

元气小坏坏 提交于 2019-12-30 04:57:04
问题 Is there a flash based document viewer? I am looking for something similar to iPaper that Scribd.com uses. 回答1: There's a great open source viewer for PDF2SWF: http://www.devaldi.com/?page_id=260 回答2: I've used PDF2SWF in the past to do basic document conversion/viewing in Flash: http://www.swftools.org/pdf2swf.html although I don't think they are as full featured as the iPaper and Scribd viewers - although it is entirely free to use. You can download from here: http://www.swftools.org

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

Disabling text selection in DocumentViewer

限于喜欢 提交于 2019-12-22 06:10:13
问题 Simple question. How do you disable the text selection of DocumentViewer in WPF? This is the feature where an XPS document is displayed by the viewer and then text can be highlighted via mouse. The highlighted text can also be copied but I have already disabled this. I just don't know how to disable the highlighting. Thanks! 回答1: We have solved this by overriding the ControlTemplate of the ScrollViewer embedded in the DocumentViewer control. Insert the Style below in "Window.Resources":