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

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
darina1234 Posted: Saturday, December 20, 2025 7:31:48 AM(UTC)
 
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.
Paul Rayman Posted: Sunday, July 20, 2025 10:00:35 PM(UTC)
 
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;
chitarrastonata Posted: Wednesday, May 7, 2025 3:59:13 AM(UTC)
 
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.bordo.png

Thanks!