Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用webbrowser wpf控件旋转PDF内容_C#_Wpf_Xaml_Pdf - Fatal编程技术网

C# 使用webbrowser wpf控件旋转PDF内容

C# 使用webbrowser wpf控件旋转PDF内容,c#,wpf,xaml,pdf,C#,Wpf,Xaml,Pdf,我已经使用webbrowser wpf控件显示了PDF,如下图所示 编写的xaml代码如下 <Window x:Class="WpfApplication2.DocViewer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ResizeMo

我已经使用webbrowser wpf控件显示了PDF,如下图所示

编写的xaml代码如下

    <Window x:Class="WpfApplication2.DocViewer"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       ResizeMode="NoResize"
       WindowState="Maximized" 
       WindowStyle="None"
       WindowStartupLocation="CenterScreen"
       Height="{Binding SystemParameters.PrimaryScreenHeight}"
       Width="{Binding SystemParameters.PrimaryScreenWidth}">
    <Grid>
        <Grid Grid.Row="0">
            <TextBlock x:Name="pdfLink" Text="" Visibility="Hidden"></TextBlock>
            <TextBlock x:Name="title" Text="" Margin="10" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15px"></TextBlock>
            <Button Cursor="Hand" VerticalAlignment="Top" Width="75" Height="35" x:Name="rotate" Margin="0,10,90,0" Content="ROTATE" Grid.ColumnSpan="1" HorizontalAlignment="Right" BorderBrush="Transparent" Foreground="Black"  FontSize="14" Click="rotate_Click">
                <Button.Effect>
                    <DropShadowEffect BlurRadius="20" ShadowDepth="0"/>
                </Button.Effect>
                <Button.Resources>
                    <Style TargetType="{x:Type Border}">
                        <Setter Property="CornerRadius" Value="10"/>
                        <Setter Property="Background" Value="White"/>
                        <Setter Property="Padding" Value="10,2,10,3"/>
                    </Style>
                </Button.Resources>
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="White"/>
                        <Setter Property="FontWeight" Value="bold"></Setter>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="Green"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

            <Button Cursor="Hand" VerticalAlignment="Top" Click="CloseButton_Click" Width="68" Height="35" x:Name="CloseButton" Margin="0,10,10,0" Content="CLOSE" Grid.ColumnSpan="1" HorizontalAlignment="Right" BorderBrush="Transparent" Foreground="Black"  FontSize="14">
                <Button.Effect>
                    <DropShadowEffect BlurRadius="20" ShadowDepth="0"/>
                </Button.Effect>
                <Button.Resources>
                    <Style TargetType="{x:Type Border}">
                        <Setter Property="CornerRadius" Value="10"/>
                        <Setter Property="Background" Value="White"/>
                        <Setter Property="Padding" Value="10,2,10,3"/>
                    </Style>
                </Button.Resources>
                <Button.Style>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Background" Value="White"/>
                        <Setter Property="FontWeight" Value="bold"></Setter>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="Green"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

        </Grid>
        <Grid Grid.Row="1">
            <WebBrowser Margin="0,60,0,0" x:Name="pdfviewer">
            </WebBrowser>
        </Grid>
    </Grid>
</Window>
我想在单击“旋转”按钮时旋转pdf文件。如果你知道,请给出任何答案

提前谢谢

public DocViewer(string viewerLocation)
        {
            InitializeComponent();
            pdfviewer.Navigate(viewerLocation);            
        }