Skip to main content

ExcelWorksheetConversionOptions

Version: 3.0

cete.dynamicpdf.conversion.excelworksheetconversionoptions

ExcelWorksheetConversionOptions​

Defines properties and methods that are needed for a Excel Workseet Conversion

public class ExcelWorksheetConversionOptions
Public Class ExcelWorksheetConversionOptions

Inheritance: Object → ExcelWorksheetConversionOptions

Licensing Info​

This class is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to ExcelWorksheetConversionOptions class.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = excelWorksheet.ConversionOptions
Dim xlPageScaling As ExcelPageScaling = excelWSOptions.PageScaling
Dim zoomxlPageScaling As ZoomExcelPageScaling = xlPageScaling.ZoomExcelPageScaling
zoomxlPageScaling.ZoomPercentage = 50
excelWorksheet.ConversionOptions.DefaultToFile = False
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
ExcelPageScaling xlPageScaling = excelWSOptions.PageScaling;
ZoomExcelPageScaling zoomxlPageScaling = xlPageScaling.ZoomExcelPageScaling;
zoomxlPageScaling.ZoomPercentage = 50;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

Constructors​

ExcelWorksheetConversionOptions(Boolean)​

Initializes a new instance of the ExcelWorksheetConversionOptions class

public ExcelWorksheetConversionOptions(bool defaultToFile)
Public Sub New (defaultToFile As Boolean)

Parameters​

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to ExcelWorksheetConversionOptions constructor with defaultToFile as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(True)
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = new ExcelWorksheetConversionOptions(true);
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

ExcelWorksheetConversionOptions(ExcelPageSize, Double)​

Initializes a new instance of the ExcelWorksheetConversionOptions class

public ExcelWorksheetConversionOptions(ExcelPageSize pageSize, double margins)
Public Sub New (pageSize As ExcelPageSize, margins As Double)

Parameters​

Size of the page

margins given in points

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to ExcelWorksheetConversionOptions constructor with ExcelPageSize and margin as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,50)
excelWSOptions.DefaultToFile=True
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = new ExcelWorksheetConversionOptions(ExcelPageSize.A4,50);
excelWSOptions.DefaultToFile=true;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

ExcelWorksheetConversionOptions(ExcelPageSize, Double, Double)​

Initializes a new instance of the ExcelWorksheetConversionOptions class.

public ExcelWorksheetConversionOptions(ExcelPageSize pageSize, double leftAndRightMargin, double topAndBottomMargin)
Public Sub New (pageSize As ExcelPageSize, leftAndRightMargin As Double, topAndBottomMargin As Double)

Parameters​

size of the page

The left and right margins of the page in points

The top and bottom margins of the page in points

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to ExcelWorksheetConversionOptions constructor with ExcelPageSize, leftAndRightmargin and topAndBottommargin as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,50,100)
excelWSOptions.DefaultToFile=True
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = new ExcelWorksheetConversionOptions(ExcelPageSize.A4,50,100);
excelWSOptions.DefaultToFile=true;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

ExcelWorksheetConversionOptions(ExcelPageSize, PageOrientation?, Double)​

Initializes a new instance of the ExcelWorksheetConversionOptions class.

public ExcelWorksheetConversionOptions(ExcelPageSize pageSize, PageOrientation? orientation, double margin)
Public Sub New (pageSize As ExcelPageSize, orientation As PageOrientation?, margin As Double)

Parameters​

Size of the page

Orientation of the page

Margin of the page in points

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to ExcelWorksheetConversionOptions constructor with ExcelPageSize, pageOrientation and margin as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,PageOrientation.Portrait,50)
excelWSOptions.DefaultToFile=True
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = new ExcelWorksheetConversionOptions(ExcelPageSize.A4,PageOrientation.Portrait,50);
excelWSOptions.DefaultToFile=true;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

ExcelWorksheetConversionOptions(ExcelPageSize, PageOrientation?, Double, Double)​

Initializes a new instance of the ExcelWorksheetConversionOptions class.

public ExcelWorksheetConversionOptions(ExcelPageSize pageSize, PageOrientation? orientation, double leftAndRightMargin, double topAndBottomMargin)
Public Sub New (pageSize As ExcelPageSize, orientation As PageOrientation?, leftAndRightMargin As Double, topAndBottomMargin As Double)

Parameters​

size of the page

orientation of the page

The left and right margins of the page in points

The top and bottom margins of the page in points

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to ExcelWorksheetConversionOptions constructor with ExcelPageSize, PageOrientation, LeftAndRightMargin and TopAndBottomMargin as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,PageOrientation.Portrait,100,50)
excelWSOptions.DefaultToFile=True
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = new ExcelWorksheetConversionOptions(ExcelPageSize.A4,PageOrientation.Portrait,100,50);
excelWSOptions.DefaultToFile=true;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

ExcelWorksheetConversionOptions(ExcelWorksheetConversionOptions)​

Initializes a new instance of the ExcelWorksheetConversionOptions class

public ExcelWorksheetConversionOptions(ExcelWorksheetConversionOptions xlWorkSheetOptions)
Public Sub New (xlWorkSheetOptions As ExcelWorksheetConversionOptions)

Parameters​

instance of the ExcelWorksheetConversionOptions class

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Properties​

BottomMargin​

manages bottom margin of the page

public Nullable&ltdouble> BottomMargin { get; set; }
Public Property BottomMargin As Nullable(Of Double)

Property Value​

Nullable&ltdouble>

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to use BottomMargin property.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,50,100)
excelWSOptions.DefaultToFile=True
excelWSOptions.BottomMargin=50
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
excelWSOptions.BottomMargin = 50;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions
}
}
}

DefaultToFile​

Use default options as per the file settings.

public bool DefaultToFile { get; set; }
Public Property DefaultToFile As Boolean

Property Value​

Boolean

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how use to DefaultToFile property.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = excelWorksheet.ConversionOptions
Dim xlPageScaling As ExcelPageScaling = excelWSOptions.PageScaling
Dim zoomxlPageScaling As ZoomExcelPageScaling = xlPageScaling.ZoomExcelPageScaling
zoomxlPageScaling.ZoomPercentage = 50
excelWorksheet.ConversionOptions.DefaultToFile = False
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
ExcelPageScaling xlPageScaling = excelWSOptions.PageScaling;
ZoomExcelPageScaling zoomxlPageScaling = xlPageScaling.ZoomExcelPageScaling;
zoomxlPageScaling.ZoomPercentage = 50;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

LeftMargin​

manages left margin of the page

public Nullable&ltdouble> LeftMargin { get; set; }
Public Property LeftMargin As Nullable(Of Double)

Property Value​

Nullable&ltdouble>

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to use LeftMargin property.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,50,100)
excelWSOptions.DefaultToFile=True
excelWSOptions.LeftMargin=50
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
excelWSOptions.LeftMargin = 50;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

Orientation​

manages orientation of the page

public Nullable&ltPageOrientation> Orientation { get; set; }
Public Property Orientation As Nullable(Of PageOrientation)

Property Value​

Nullable&ltPageOrientation>

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to use PageOrientaion property.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,50,100)
excelWSOptions.DefaultToFile=True
excelWSOptions.Orientation=PageOrientation.Portrait
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
excelWSOptions.Orientation = PageOrientation.Portrait;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

PageScaling​

manages page scaling

public ExcelPageScaling PageScaling { get; set; }
Public Property PageScaling As ExcelPageScaling

Property Value​

ExcelPageScaling

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to ExcelWorksheetConversionOptions class.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = excelWorksheet.ConversionOptions
Dim xlPageScaling As ExcelPageScaling = excelWSOptions.PageScaling
Dim zoomxlPageScaling As ZoomExcelPageScaling = xlPageScaling.ZoomExcelPageScaling
zoomxlPageScaling.ZoomPercentage = 50
excelWorksheet.ConversionOptions.DefaultToFile = False
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
ExcelPageScaling xlPageScaling = excelWSOptions.PageScaling;
ZoomExcelPageScaling zoomxlPageScaling = xlPageScaling.ZoomExcelPageScaling;
zoomxlPageScaling.ZoomPercentage = 50;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

PageSize​

manages page size

public ExcelPageSize PageSize { get; set; }
Public Property PageSize As ExcelPageSize

Property Value​

ExcelPageSize

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to ExcelPageSize property.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = excelWorksheet.ConversionOptions
excelWSOptions.PageSize=ExcelPageSize.A4
excelWorksheet.ConversionOptions.DefaultToFile = False
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
excelWSOptions.PageSize=ExcelPageSize.A4;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions;
}
}
}

RightMargin​

manages right margin of the page

public Nullable&ltdouble> RightMargin { get; set; }
Public Property RightMargin As Nullable(Of Double)

Property Value​

Nullable&ltdouble>

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to use RightMargin property.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,50,100)
excelWSOptions.DefaultToFile=True
excelWSOptions.RightMargin=50
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
excelWSOptions.RightMargin = 50;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions
}
}
}

TopMargin​

manages top margin of the page

public Nullable&ltdouble> TopMargin { get; set; }
Public Property TopMargin As Nullable(Of Double)

Property Value​

Nullable&ltdouble>

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

Example shows how to use TopMargin property.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx")

' Events to know if conversion completed successfully or not
AddHandler excelConversionDocumentParsing, AddressOf xlConverter_DocumentParsing

' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")

End Sub

Sub xlConverter_DocumentParsing(ByVal sender As Object, ByVal e As ExcelDocumentParsingEventArgs)
For Each excelWorksheet As ExcelWorksheet In e.Worksheets
Dim excelWSOptions As ExcelWorksheetConversionOptions = New ExcelWoorksheetConversionOptions(ExcelPageSize.A4,50,100)
excelWSOptions.DefaultToFile=True
excelWSOptions.topMargin=50
excelWorksheet.ConversionOptions=excelWSOptions
Next
End Sub
End Module

using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx");

excelConverter.DocumentParsing += new ExcelDocumentParsing(xlConverter_DocumentParsing);

//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
static void xlConverter_DocumentParsing(object sender, ExcelDocumentParsingEventArgs e)
{
foreach (ExcelWorksheet excelWorksheet in e.Worksheets)
{
ExcelWorksheetConversionOptions excelWSOptions = excelWorksheet.ConversionOptions;
excelWSOptions.TopMargin= 50;
excelWorksheet.ConversionOptions.DefaultToFile = false;
excelWorksheet.ConversionOptions=excelWSOptions
}
}
}

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​

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 Converter feature. One of the following is required for non-evaluation usage:

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 Converter feature. One of the following is required for non-evaluation usage:

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 Converter feature. One of the following is required for non-evaluation usage:

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 Converter feature. One of the following is required for non-evaluation usage:

See Also​

ceTe.DynamicPDF.Conversion