#256 – 使用FixedDocument 在指定的地方显示内容(Use a FixedDocument to Display Content at Fixed Locations)
2016-09-09 18:02
477 查看
FlowDocument 会自动的根据显示的内容进行分页,而FixedDocument 可以控制分页,你可以一页页的添加内容,并指定内容显示在某一页。
FixedDocument 里面会包含若干个PageContent 实例,每个PageContent 实例中都包含FixedPage 实例。
上面的代码中FixedDocument 包含了两个PageContent 实例,每个PageContent 代表一页。每个PageContent 中都有FixedPage ,包含了要显示的内容。显示效果如下:
第一页
![](https://2000thingswpf.files.wordpress.com/2011/03/001-page1.png?w=630&h=354)
第二页
![](https://2000thingswpf.files.wordpress.com/2011/03/002-page2.png?w=630&h=516)
原文地址:https://wpf.2000things.com/2011/03/25/256-use-a-fixeddocument-to-display-content-at-fixed-locations/
FixedDocument 里面会包含若干个PageContent 实例,每个PageContent 实例中都包含FixedPage 实例。
<FixedDocument> <PageContent> <!-- 7" x 9" page --> <FixedPage Width="672" Height="864"> <StackPanel Orientation="Vertical" FixedPage.Left="280" FixedPage.Top="150"> <Label FontFamily="Arial" FontWeight="Bold" FontSize="18" Content="Jane Eyre" HorizontalAlignment="Center"/> <Label FontFamily="Arial" FontStyle="Italic" FontSize="14" Content="Charlotte Brontë" HorizontalAlignment="Center"/> </StackPanel> </FixedPage> </PageContent> <PageContent> <FixedPage Width="672" Height="864"> <StackPanel Margin="48"> <TextBlock FontFamily="Cambria" FontSize="14" Width="576" TextWrapping="Wrap"> There was no possibility etc. </TextBlock> <TextBlock FontFamily="Cambria" FontSize="14" Width="576" TextWrapping="Wrap" Margin="0,25,0,0"> I was glad of it etc. </TextBlock> <Image Margin="0,25,0,0" Source="Twilight.jpg" /> </StackPanel> </FixedPage> </PageContent> </FixedDocument>
上面的代码中FixedDocument 包含了两个PageContent 实例,每个PageContent 代表一页。每个PageContent 中都有FixedPage ,包含了要显示的内容。显示效果如下:
第一页
![](https://2000thingswpf.files.wordpress.com/2011/03/001-page1.png?w=630&h=354)
第二页
![](https://2000thingswpf.files.wordpress.com/2011/03/002-page2.png?w=630&h=516)
原文地址:https://wpf.2000things.com/2011/03/25/256-use-a-fixeddocument-to-display-content-at-fixed-locations/
相关文章推荐
- 使用dsoframer控件出现"Unable to display the inactive document. Click here to reactivate the document."的问题 .
- winform中使用dsoframer提示"Unable to display the inactive document.Click here to reacitive the document."
- Rails 使用iframe报错:IFRAME: Refused to display document because display forbidden by X-Frame-Options
- #371 – 指定日历控件显示的日期时间(Specifying a Default Date for a Calendar Control to Display)
- Learn to use filter to display content
- maven插件rebuild index的时候0%不变,Progress显示No operations to display at this time.
- 使用dsoframer控件出现"Unable to display the inactive document. Click here to reactivate the document."的问题
- wordpress指定内容分享到微博后才显示之share to view all插件及其自动分享到微博的实现
- Thinkphp中使用display()方法显示视图模板,使用show()方法是显示文本内容
- [转]Importing documents to Document Libraries with Mavention Import Document Library Contents(使用VS插件导出文档库内容定义)
- 使用dsoframer控件出现"Unable to display the inactive document. Click here to reactivate the document."的问题
- 解决linux VPS安装weblogic时碰到的显示问题Checking monitor: must be configured to display at least 256 colors
- 【js】:js如何实现给网页某一地方显示指定内容
- 使用iframe调用指定网页的特定位置(显示目标网页某区域的我想要的内容)
- winform正在使用dsoframer迅速"Unable to display the inactive document.Click here to reacitive the document."
- 内容较少时,页面的footer始终显示在底部,不是使用fixed。
- 【HTML】使用iframe标签显示目标网页(内容)的指定区域(转)
- 【HTML】使用iframe标签显示目标网页(内容)的指定区域
- #246 – 在文档中使用FlowDocument控件(Use FlowDocument Control to Host Entire Documents)
- 当使用restore .bak文件的时候.显示如信息:Use WITH MOVE to identify a valid location for the file