0

我有点需要帮助。我正在尝试使用键盘在 Patagames PDFium .net 控件中滚动 PDF。不幸的是,我无法让它正确滚动,我正在寻找一些示例代码(VB 或 C#)来滚动“line wize(让我们说每个按键 10 个像素)”和“page wize”。有人可以帮我吗?TIA 很多。奥莱

4

1 回答 1

0

没关系。找到了答案。

   Private Sub PdfViewer1_KeyDown(sender As Object, e As KeyEventArgs) Handles PdfViewer1.KeyDown

      Dim pageStep As Integer = PdfViewer1.AutoScrollMinSize.Height / PdfViewer1.Document.Pages.Count
      Dim lineStep As Integer = pageStep / 30
      Dim asp As Point = PdfViewer1.AutoScrollPosition


      Select Case e.KeyCode
         Case Keys.Up
            PdfViewer1.AutoScrollPosition = New Point(asp.X, -asp.Y - lineStep)
         Case Keys.Down
            PdfViewer1.AutoScrollPosition = New Point(asp.X, -asp.Y + lineStep)
         Case Keys.PageUp
            PdfViewer1.AutoScrollPosition = New Point(asp.X, -asp.Y - pageStep)
         Case Keys.PageDown
            PdfViewer1.AutoScrollPosition = New Point(asp.X, -asp.Y + pageStep)
      End Select

   End Sub
于 2018-06-07T08:21:19.237 回答