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

Notification

Icon
Error

Options
Go to last post Go to first unread
Guest  
#1 Posted : Thursday, April 14, 2016 4:28:04 AM(UTC)
Guest

Rank: Guest

Groups: Guests
Joined: 1/5/2016(UTC)
Posts: 162

Was thanked: 5 time(s) in 5 post(s)
Hi,

when i zoom on my pdf i have this screen not all the time...
How can i solve this issue ?

Thanks

UserPostedImage
Paul Rayman  
#2 Posted : Friday, April 15, 2016 4:24:24 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
You must limit the maximum size of the page when zooming
Guest  
#3 Posted : Friday, April 22, 2016 1:53:05 AM(UTC)
Guest

Rank: Guest

Groups: Guests
Joined: 1/5/2016(UTC)
Posts: 162

Was thanked: 5 time(s) in 5 post(s)
how i can do that please ?
Paul Rayman  
#4 Posted : Friday, April 22, 2016 3:49:39 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
somehow like this:

Code:

protected override void OnMouseWheel(MouseEventArgs e)
{
	if ((ModifierKeys & Keys.Control) == Keys.Control)
	{
		float newZoom = Zoom;
		if (e.Delta < 0)
			newZoom *= 0.9f;
		else
			newZoom /= 0.9f;

		if (_maxPageSize * newZoom >100 &&_maxPageSize * newZoom < 5000)
			Zoom = newZoom;

	}
	else
		base.OnMouseWheel(e);
}
Guest  
#5 Posted : Monday, April 25, 2016 12:19:01 AM(UTC)
Guest

Rank: Guest

Groups: Guests
Joined: 1/5/2016(UTC)
Posts: 162

Was thanked: 5 time(s) in 5 post(s)
it doesn't work and i need to be able to zoom on a element. but with your method i can zoom 150 % max.

i catch pdfiumexception or outofmemory


Code:
Point p = e.GetPosition(null);
            float newzoom = this.pdfViewer.Zoom;
            if (e.Delta > 0)
            {
                newzoom /= 0.9f;
            }
            else
            {
                newzoom *= 0.9f;
            }
            if (700 * newzoom > 100 && 700 * newzoom < 5000)
            {
                this.pdfViewer.Zoom = newzoom;
                this.pdfViewer.PageToClient(this.pdfViewer.CurrentIndex, p);
            }


how can i know the _maxPageSize varible and i use wpf

error :

Patagames.Pdf.Net.Exceptions.PdfiumException: Unexpected error code.
at Patagames.Pdf.Net.PdfBitmap..ctor(IntPtr handle)
at Patagames.Pdf.Net.PdfBitmap.Clone(FX_RECT clip)
at Patagames.Pdf.Net.Controls.Wpf.PdfViewer.DrawPage(DrawingContext drawingContext, PdfPage page, Rect actualRect)

Edited by user Tuesday, April 26, 2016 1:21:30 AM(UTC)  | Reason: Not specified

Users browsing this topic
Guest
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.