Rank: Newbie
Groups: Registered
Joined: 5/7/2025(UTC) Posts: 1  Location: Milan
|
I'm developing a program to display my sheet music on a Windows tablet (Microsoft Surface). The PDFs contain only one page, and I generate them myself using Word. The issue is that when viewing the PDF in full screen using PdfRenderer, it does not completely fill the display. The PDF page is rendered with page borders, and around the rendered page, there is additional empty space, making the PDF content appear smaller than the available display space. I want to make full use of the display by eliminating both the page border and the extra empty space that appears around it. I have tried setting Padding and Margin to zero, but that does not solve the problem. How can I achieve this? I have attached an image showing the top part of the screen as it currently displays the PDF.  Thanks!
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,125
Thanks: 10 times Was thanked: 132 time(s) in 129 post(s)
|
Hello, Winforms: The page border is always displayed outside of its area. So the following will help you achieve your goal. Code:this.SizeMode = SizeModes.FitToWidth;
this.ShowCurrentPageHighlight = false;
this.PageMargin = new Padding(0);
this.Padding = new Padding(0);
WPF: Code:this.SizeMode = SizeModes.FitToWidth;
this.ShowCurrentPageHighlight = false;
this.PageMargin = new System.Windows.Thickness(0);
this.Padding = new System.Windows.Thickness(0);
this.PageBorderColor = Colors.White;
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/20/2025(UTC) Posts: 1  Location: New Zealand
|
PdfRenderer always respects the PDF page box, so those “borders” are usually baked into the file by Word. Zero padding won’t help. Either export the PDF with zero margins in Word, or crop the page using the PDF crop box (iText/PdfBox). In code, render into a bitmap scaled to your view with a Matrix to fill the screen.
|
|
|
|
|
|
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