private void InitUI() { Size contentSize = UtilsHelper.GetPDFDisplayAreaSize(); WindowsFormsHost1.SetValue(Canvas.WidthProperty, contentSize.Width); WindowsFormsHost1.SetValue(Canvas.HeightProperty, contentSize.Height); pdfViewer = new PDFViewer(); pdfViewer.Rotate = 3; WindowsFormsHost1.Child = pdfViewer; }
private void InitUI() { //设置窗体按比例尺寸 double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double h = screenHeight - SystemParameters.CaptionHeight - SystemParameters.MenuBarHeight; double w = Math.Floor(Constants.A4Width * h / Constants.A4Height); this.SetValue(Window.WidthProperty, w); this.SetValue(Window.HeightProperty, h); this.SetValue(Window.TopProperty, 0d); this.SetValue(Window.LeftProperty, 0d); WindowsFormsHost1.SetValue(Canvas.WidthProperty, w); WindowsFormsHost1.SetValue(Canvas.HeightProperty, h); pdfReader = new PDFViewer(); WindowsFormsHost1.Child = pdfReader; }