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
fmotsch  
#1 Posted : Tuesday, March 27, 2018 3:32:15 AM(UTC)
Quote
fmotsch

Rank: Member

Groups: Registered
Joined: 2/6/2018(UTC)
Posts: 11
France
Location: Paris

Thanks: 6 times
Hello,

I'm trying to make sure that my PDFs are open at the position 0,0 of the pdfViewer.
I'm using these lines but it doesn't works:

Code:

this.pdfViewer.LoadDocument(filePath, this.done);
this.pdfViewer.Zoom = 0.75F;
this.pdfViewer.ScrollToPoint(this.pdfViewer.CurrentIndex, new Point(0, 0));


Do you have a solution ?
Paul Rayman  
#2 Posted : Tuesday, March 27, 2018 5:19:56 AM(UTC)
Quote
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)
Try to set Padding and PageMargin to zero
and PageAlignment to Left and Top

Edited by user Tuesday, March 27, 2018 5:20:27 AM(UTC)  | Reason: Not specified

thanks 1 user thanked Paul Rayman for this useful post.
fmotsch on 3/27/2018(UTC)
fmotsch  
#3 Posted : Tuesday, March 27, 2018 6:06:57 AM(UTC)
Quote
fmotsch

Rank: Member

Groups: Registered
Joined: 2/6/2018(UTC)
Posts: 11
France
Location: Paris

Thanks: 6 times
That works great, thanks.

But now i have a new problem that I didn't see coming.
Some of my PDF are at the A4 format and other are way longer.
I don't need for my A4 PDF to be on the left top corner of the pdfViewer. (It's ugly)
Is there a function to get the size of my page?)

My code would look a bit like that fake code. I'm gonna check if it works...

Code:
if(pdfViewer.CurrentPage.Width() > A4.format)
{
    this.pdfViewer.PageHAlign = 0;
    this.pdfViewer.PageVAlign = 0;
    pdfViewer.Padding = new Thickness(0, 0, 0, 0);
}



IT WORKS !!!!!
THANKS...

Edited by user Tuesday, March 27, 2018 6:19:35 AM(UTC)  | Reason: Not specified

Paul Rayman  
#4 Posted : Tuesday, March 27, 2018 6:23:43 AM(UTC)
Quote
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)
Code:

float width_in_inches = page.Width/72;
float height_in_inches = page.Height/72;
Quick Reply Show Quick Reply
Users browsing this topic
Guest (4)
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.