by rtourangeau » Tue Jun 29, 2021 9:55 am
This is my code.
-- code behind C# WPF
public winVisualisation()
{
InitializeComponent();
Cef.EnableHighDPISupport();
WebBPDFVisualiser.IsBrowserInitializedChanged += OnBrowserInitialized;
}
private void OnBrowserInitialized(object sender, DependencyPropertyChangedEventArgs e)
{
if (WebBPDFVisualiser.IsBrowserInitialized)
{
WebBPDFVisualiser.SetZoomLevel(2);
WebBPDFVisualiser.NotifyDpiChange(2);
}
}
--XMAL header
<Window x:Class="DocNumerique.Win.winVisualisation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
Title="Visualisation d'un document" Height="925" Width="1275" LocationChanged="Window_LocationChanged" Loaded="Window_Loaded"
WindowStartupLocation="Manual" WindowState="Maximized" ResizeMode="NoResize" Closed="Window_Closed" WindowStyle="None" ShowInTaskbar="False">
--XMAL tag
<cefSharp:ChromiumWebBrowser Name="WebBPDFVisualiser" Visibility="Visible" Grid.Column="2" Margin="10,10,5,10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" OpacityMask="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrushKey}}" />
Thanks