cete.dynamicpdf.printing.margin
Margin
- Namespace: ceTe.DynamicPDF.Printing
- Assemblies: DynamicPDF.Printing.dll
Puts margin for pages while doing a multi page print.
public class Margin
Public Class Margin
Inheritance: Object → Margin
Licensing Info
This class is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Examples
The following examples demonstrates, how to set margin for pages while doing the multi page print.
Imports ceTe.DynamicPDF.Printing
Imports System.Drawing
Module MyModuleSub Main() ' Create a print job containing the first four pages of the PDF. Dim printJob As New PrintJob(Printer.[Default], "C:\MyDocument.pdf", 1, 4)
' Creating the object of MultipagePageScaling. Dim multipagePageScaling As New MultipagePageScaling(4, 2)
' Setting the border and its color. multipagePageScaling.Border = New Border(Color.Green, 2)
' Setting the top,left,bottom and right margins. multipagePageScaling.Margin = New ceTe.DynamicPDF.Printing.Margin(5, 5, 5, 5)
' Setting the spacing between pages. multipagePageScaling.Spacing = New Spacing(2, 2)
' If UniformScaling is true then same scaling percentage will be applied to all pages. multipagePageScaling.UniformScaling = True
' Applying the multipage scaling. printJob.PrintOptions.Scaling = multipagePageScaling
' Print the job. printJob.Print()End Sub
End Module
using System;
using ceTe.DynamicPDF.Printing;
using System.Drawing;
class MyClass
{static void Main(){ // Create a print job containing the first four pages of the PDF. PrintJob printJob = new PrintJob(Printer.Default, @"C:\MyDocument.pdf", 1, 4);
// Creating the object of MultipagePageScaling. MultipagePageScaling multipagePageScaling = new MultipagePageScaling(4, 2);
// Setting the border and its color. multipagePageScaling.Border = new Border(Color.Green, 2);
// Setting the top,left,bottom and right margins. multipagePageScaling.Margin = new ceTe.DynamicPDF.Printing.Margin(5, 5, 5, 5);
// Setting the spacing between pages. multipagePageScaling.Spacing = new Spacing(2, 2);
// If UniformScaling is true then same scaling percentage will be applied to all pages. multipagePageScaling.UniformScaling = true;
// Applying the multipage scaling. printJob.PrintOptions.Scaling = multipagePageScaling;
// Print the job. printJob.Print();}
}
Constructors
Margin(Int32)
Initializes a new instance of the Margin class using the supplied margin size for all edges.
public Margin(int margin)
Public Sub New (margin As Integer)
Parameters
- margin: Int32
The margin size for the all edges.
Licensing Info
This constructor is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Margin(Int32, Int32)
Initializes a new instance of the Margin class using a separate margin size for top, bottom and left, right.
public Margin(int topBottom, int leftRight)
Public Sub New (topBottom As Integer, leftRight As Integer)
Parameters
- topBottom: Int32
The margin size for the top and bottom edges.
- leftRight: Int32
The margin size for the left and right edges.
Licensing Info
This constructor is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Margin(Int32, Int32, Int32, Int32)
Initializes a new instance of the Margin class using a separate margin size for each edge.
public Margin(int left, int top, int right, int bottom)
Public Sub New (left As Integer, top As Integer, right As Integer, bottom As Integer)
Parameters
- left: Int32
The margin size for the left edge.
- top: Int32
The margin size for the top edge.
- right: Int32
The margin size for the right edge.
- bottom: Int32
The margin size for the bottom edge.
Licensing Info
This constructor is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Properties
Bottom
Gets or sets the margin value for the bottom edge.
public int Bottom { get; set; }
Public Property Bottom As Int32
Property Value
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Left
Gets or sets the margin value for the left edge.
public int Left { get; set; }
Public Property Left As Int32
Property Value
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Right
Gets or sets the margin value for the right edge.
public int Right { get; set; }
Public Property Right As Int32
Property Value
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Top
Gets or sets the margin value for the top edge.
public int Top { get; set; }
Public Property Top As Int32
Property Value
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Methods
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.