我需要用C1PdfViewer 在线显示PDF,按官网示例进行书签的处理
<Grid x:Name="LayoutRoot" Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ScrollViewer Width="Auto" Padding="0" Background="White" Style="{StaticResource GralScrollViewer}" Margin="0,0,10,0">
<c1:C1TreeView Name="bookMarks" SelectionMode="Single" SelectionChanged="C1TreeView_SelectionChanged" BorderThickness="0">
<c1:C1TreeView.ItemTemplate>
<c1:C1HierarchicalDataTemplate ItemsSource="{Binding Children}">
<TextBlock Text="{Binding Title}" />
</c1:C1HierarchicalDataTemplate> </c1:C1TreeView.ItemTemplate>
</c1:C1TreeView>
</ScrollViewer>
<c1:C1PdfViewer Name="pdfViewer" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ToolbarStyle="{StaticResource C1PdfViewerToolbarDefaultStyle}" />
</Grid>
后台代码为 WebResponse response = request.EndGetResponse(responseAsyncCallBack);
Stream responseStream = response.GetResponseStream();
responseStream.Position = 0;
this.Dispatcher.BeginInvoke(() =>
{
pdfViewer.LoadDocument(responseStream);
bookMarks.ItemsSource = pdfViewer.Bookmarks;
});
在实际使用中,中文WORD文档,在树状上显示 为乱码:
如 第1章 软件简介 显示为 `_ ?"lF¸äèÅ?sã)?ZNHÄ
对于此PDF文档,我用第三方PDF工具打开,显示正常的文字。
请问如何解决 |
|