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

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
bosslaw  
#1 Posted : Wednesday, April 22, 2020 2:00:56 AM(UTC)
Quote
bosslaw

Rank: Newbie

Groups: Registered
Joined: 4/22/2020(UTC)
Posts: 3
Philippines
Location: Batangas

Thanks: 1 times
Hi,

I have loaded the document in the pdfviewer.

Now, I need to get the size of the current page when I zoom in and zoom out. Is there a way to access the width and height properties?

I have tried this.pdfViewer1.CurrentPage.Document.Pages[0].Height and Width but these properties are not changing when I zoom in and zoom out.

Thanks in advance for help.
Paul Rayman  
#2 Posted : Wednesday, April 22, 2020 5:58:23 AM(UTC)
Quote
Paul Rayman

Rank: Administration

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

Thanks: 3 times
Was thanked: 110 time(s) in 107 post(s)
Hi.

Well... you can try such a trick.

Code:

var page = pdfViewer1.CurrentPage;
var ptLeftBottom = pdfViewer1.PageToClient(page.PageIndex, new Point(0, 0));
var ptRightUp = pdfViewer1.PageToClient(page.PageIndex, new PointF(page.Width, page.Height));
int width = Math.Abs(ptRightUp.X - ptLeftBottom.X);
int height = Math.Abs(ptRightUp.Y - ptLeftBottom.Y);
thanks 1 user thanked Paul Rayman for this useful post.
bosslaw on 5/11/2020(UTC)
bosslaw  
#3 Posted : Wednesday, April 22, 2020 9:00:53 AM(UTC)
Quote
bosslaw

Rank: Newbie

Groups: Registered
Joined: 4/22/2020(UTC)
Posts: 3
Philippines
Location: Batangas

Thanks: 1 times
thank you very much for the code Paul. It helped a lot.
Quick Reply Show Quick Reply
Users browsing this topic
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.