We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ab50fd commit 5851c25Copy full SHA for 5851c25
Images/Add-image-as-background-in-PDF/.NET/Add-image-as-background-in-PDF/Program.cs
@@ -5,6 +5,8 @@
5
// Create the new PDF document
6
using (PdfDocument document = new PdfDocument())
7
{
8
+ //Set margin
9
+ document.PageSettings.Margins.All = 0;
10
// Add a new page to the document
11
PdfPage page = document.Pages.Add();
12
// Get the client size
@@ -25,8 +27,8 @@
25
27
new SizeF(clientSize.Width, clientSize.Height)
26
28
);
29
page.Graphics.Restore(state);
- // Define a small margin for the text content.
- const float margin = 10f;
30
+ // Define a margin for the text content.
31
+ const float margin = 40f;
32
// Text bounds: fill the page within margins.
33
RectangleF textBounds = new RectangleF(
34
margin,
0 commit comments