Rank: Newbie
Groups: Registered
Joined: 4/21/2020(UTC) Posts: 3  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.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 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);
|
 1 user thanked Paul Rayman for this useful post.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/21/2020(UTC) Posts: 3  Location: Batangas Thanks: 1 times
|
thank you very much for the code Paul. It helped a lot.
|
|
|
|
|
|
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.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close