Welcome Guest! To enable all features please Login or Register.



Go to last post Go to first unread
#1 Posted : Thursday, January 14, 2021 7:03:40 AM(UTC)

Rank: Newbie

Groups: Registered
Joined: 11/10/2020(UTC)
Posts: 1
Location: Borgomanero

Hi everyone,

We're developing a WPF app for touchscreen devices using WPF PDF viewer:
are touch events directly supported?

As far as now we're intercepting manipulation events,like this:

void ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
            int idx = PDFviewer.CurrentIndex;
            var mousePoint = e.ManipulationOrigin;
            var leftTopPagePoint = PDFviewer.ClientToPage(idx, new Point(0, 0));
            var pagePoint = PDFviewer.ClientToPage(idx, mousePoint);

            if (e.DeltaManipulation.Scale.X < 1 && PDFviewer.Zoom > 0.4)
                PDFviewer.Zoom /= zoomFactor;
            else if (e.DeltaManipulation.Scale.X > 1)
                PDFviewer.Zoom *= zoomFactor;
            PDFviewer.SizeMode = SizeModes.Zoom;

            var newPagePoint = PDFviewer.ClientToPage(idx, mousePoint);
            var offsetPoint = new Point(newPagePoint.X - pagePoint.X, newPagePoint.Y - pagePoint.Y);

            var scrollPoint = new Point(leftTopPagePoint.X - offsetPoint.X, leftTopPagePoint.Y - offsetPoint.Y);

            PDFviewer.ScrollToPoint(idx, scrollPoint);

It works, but it's basic, we're looking for a better user experience.
Also, panning works fine with stylus but not with finger touches.

Can anyone point us in the right direction?
Thanks in advance!

Users browsing this topic
Similar Topics
How to add context menu in WPF PdfViewer (Common Questions)
by Guest 9/8/2016 7:49:52 PM(UTC)
WPF PDFViewer resizing (Common Questions)
by eagleview 1/31/2016 8:39:43 PM(UTC)
WPF PDFviewer text clarity problem (Common Questions)
by BelikovSeregy 1/27/2016 3:03:46 AM(UTC)
Is there any way to find and highlight text in WPF PDFviewer? (Common Questions)
by BelikovSeregy 1/27/2016 2:59:11 AM(UTC)
WPF PdfViewer doesn't support binding (Common Questions)
by Guest 1/26/2016 4:56:36 PM(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.