Syncfusion.Pdf.Base
Members  Example 


PdfMargins Class

A class representing PDF page margins.
Syntax
'Declaration
 
Public Class PdfMargins 
'Usage
 
Dim instance As PdfMargins
public class PdfMargins 
Example
//Creates a new PDF document.
PdfDocument document = new PdfDocument();
//Create new PDF margin.
PdfMargins margin = new PdfMargins();
//Set all the side of the page margin.
margin.All = 20;       
//Set margin
document.PageSettings.Margins = margin;
//Adds a page.PdfPage 
PdfPage page = document.Pages.Add();
//Creates PDF graphics for the page.
PdfGraphics graphics = page.Graphics;
//Draws the String.
graphics.DrawRectangle(PdfPens.Red, new RectangleF(new PointF(0, 0), page.GetClientSize()));
//Saves the document.
document.Save("output.pdf");
//Closes the document.
document.Close(true);
'Creates a new PDF document.
Dim document As New PdfDocument()
'Create new PDF margin.
Dim margin As New PdfMargins()
'Set all the side of page margin.
margin.All = 20        
'Set margin.
document.PageSettings.Margins = margin
'Adds a page.PdfPage 
Dim page As PdfPage = document.Pages.Add()
'Creates PDF graphics for the page.
Dim graphics As PdfGraphics = page.Graphics
'Draws the String.
graphics.DrawRectangle(PdfPens.Red, New RectangleF(New PointF(0, 0), page.GetClientSize()))
'Saves the document.
document.Save("output.pdf")
'Closes the document.
document.Close(True)
Inheritance Hierarchy

System.Object
   Syncfusion.Pdf.Graphics.PdfMargins

AssemblyVersion

Syncfusion.Pdf.Base: 18.1460.0.42

See Also