flowdocument

Saving FlowDocument to SQL Server

送分小仙女□ 提交于 2019-12-18 06:48:33
问题 I need to save WPF FlowDocuments to SQL Server. What is the best format for doing that? String? Blob? Does it matter in a document less than 5K words or so? 回答1: If you just want to store the FlowDocument objects in a database, without any processing, I would recommend using binary serialization, and storing the resulting byte array into a varbinary(max). This is fast and scales well. However, if you already have the FlowDocuments as XML files, than it would be easier just to dump them into a

How can I produce a “print preview” of a FlowDocument in a WPF application?

拈花ヽ惹草 提交于 2019-12-17 07:06:34
问题 Various WPF applications of mine display FlowDocument's. I'm able to print them, using the approach described in the answer to Printing a WPF FlowDocument. Now I'd like to add a "print preview" capability. In the normal case, I am printing the FlowDocument that is displayed in the Window, and so I wouldn't need a Print Preview then. But in some cases the FlowDocument to print is constructed on-the-fly in memory. And in these cases I'd like to display it before printing. Now, I can certainly

Insert white space of arbitrary width to FlowDocument

送分小仙女□ 提交于 2019-12-14 03:14:19
问题 Is there a way to insert white space of given width to FlowDocument as Inline ? So that I can 'indent' some other Inline s as I want. If it was possible to place some inline on some x-offset in the line that would also solve the problem. NOTE: the purpose of this would be solving partial problem of the problem described in this question. 回答1: You could use the container classes, e.g.: <RichTextBox> <FlowDocument> <Paragraph> <InlineUIContainer> <FrameworkElement Width="200"/> <

Navigating to a specific fragment in a flow document from code behind

╄→гoц情女王★ 提交于 2019-12-13 03:32:45
问题 I have a WPF page used as an input form which contains a number of controls on one side, and a flow document reader on the other. I want to set the content of this document reader to a specific part of a flow document which is loaded when the form is loaded, (via a loaded event). I have found an article explaining how to do this, using fragments, but the examples shown are only expressed in XAML. In my case I need to update the document property of the flow document reader when the user gives

WPF FlowDocument: force calculation of height etc. “off screen”

ⅰ亾dé卋堺 提交于 2019-12-12 17:42:07
问题 My target: a DocumentPaginator which takes a FlowDocument with a table, which splits the table to fit the pagesize and repeat the header/footer (special tagged TableRowGroups) on every page. For splitting the table I have to know the heights of its rows. While building the FlowDocument-table by code, the height/width of the TableRows are 0 (of course). If I assign this document to a FlowDocumentScrollViewer (PageSize is set), the heights etc. are calculated. Is this possible without using an

Lightly styled text library for WPF?

风流意气都作罢 提交于 2019-12-12 13:28:42
问题 Does anyone know of a lightly-marked-up-text to styled-text formatting library (ie. something like Markdown# or Textile.NET), but which produces a native XAML document (or rather, a FlowDocument model or similar that can be displayed directly in a WPF app), to avoid the use of a WebBrowser? Bonus points for something lightweight. I'm hoping for something that will tolerate very frequent updates in the source text. Alternatively, is there a lightweight HTML rendering control that can be used

Regex Split at beginning of line containing word

笑着哭i 提交于 2019-12-12 13:01:06
问题 I'm trying to split a text into paragraphs each time a line contains a certain word. I already managed to split the text at the beginning of that word, but not at the beginning of the line containing that word. what's the right expression? this is what I have string[] paragraphs = Regex.Split(text, @"(?=INT.|EXT.)"); I also want to lose any empty paragraphs in the array. this is the input INT. LOCATION - DAY Lorem ipsum dolor sit amet, consectetur adipiscing elit. LOCATION - EXT. Morbi cursus

WPF Printing - Multipage Invoice Via Flowdocument, Paginator and FixedDocument

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 09:14:37
问题 We're currently using WPF to create a multi-page invoice document, to then be printed / exported via XPS. The route we've taken to achieve this is to create a UserControl containing a standard ListBox etc displaying the Invoice lines, this is then included in a FlowDocument inside BlockUIContainer tags. When this FlowDocument is placed inside FlowDocumentScrollViewer tags in a window, it works perfectly, with the databound content of the UserControl displaying properly. However, when we try

Is there an ItemsControl equivalent for text content?

非 Y 不嫁゛ 提交于 2019-12-12 08:06:18
问题 I have some data that I want to present in a FlowDocument . This will basically be a view that explains the data in a friendly way, with section headers, paragraphs of text, etc., and which I will display in a FlowDocumentScrollViewer. To this end, I would like to create a bulleted list ( <List> ) out of the contents of an ObservableCollection . I know how to do that with ItemsControl , but how do I do it for ListItem elements in a FlowDocument , since they're part of the TextElement class

(C# WPF) How to change textrange background color?

送分小仙女□ 提交于 2019-12-12 01:13:44
问题 I am using a "flowdocumentreader" to show text, the xaml code of the "flowdocumentreader" is simple: <FlowDocumentReader x:Name="myDocumentReader" ViewingMode="Scroll" VerticalAlignment="Stretch" ContextMenuOpening="myDocumentReader_ContextMenuOpening" Margin="0,0,0,0" Grid.Row="1" PreviewMouseDown="myDocumentReader_PreviewMouseDown"> <FlowDocument x:Name="flow" LineHeight="{Binding ElementName=slider2, Path=Value}" PagePadding="{Binding ElementName=slider, Path=Value}"> <Paragraph x:Name=