cete.dynamicpdf.conversion.zoomexcelpagescaling
ZoomExcelPageScaling
- Namespace: ceTe.DynamicPDF.Conversion
- Assemblies: DynamicPDF.Converter.dll
Represents the ZoomExcelPageScaling for the ExcelPageScaling.
public class ZoomExcelPageScaling
Public Class ZoomExcelPageScaling
Inheritance: Object → ZoomExcelPageScaling
Licensing Info
This class is a DynamicPDF Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
Examples
Example shows how to use ZoomExcelPageScaling 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
ZoomExcelPageScaling()
Initializes a new instance of the ZoomExcelPageScaling class.
public ZoomExcelPageScaling()
Public Sub New ()
Licensing Info
This constructor is a DynamicPDF Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
Examples
Example shows how to use ZoomExcelPageScaling constructor.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Create new instance of conversionOptions.
Dim conversionOptions As ExcelConversionOptions = New ExcelConversionOptions(ExcelPageSize.A4,10,10)
Dim zoomExcelPageScaling As ZoomExcelPageScaling = New ZoomExcelPageScaling()
zoomExcelPageScaling.ZoomPercentage=50
Dim excelPageScaling As ExcelPageScaling = New ExcelPageScaling()
excelPageScaling.ZoomExcelPageScaling = zoomExcelPageScaling
conversionOptions.PageScaling = excelPageScaling
' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx",conversionOptions)
' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")
End Sub
End Module
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
//Create new instance of conversionOptions.
ExcelConversionOptions conversionOptions = new ExcelConversionOptions(ExcelPageSize.A4,10,10);
ZoomExcelPageScaling zoomExcelPageScaling = new ZoomExcelPageScaling();
zoomExcelPageScaling.ZoomPercentage=50;
ExcelPageScaling excelPageScaling = new ExcelPageScaling();
excelPageScaling.ZoomExcelPageScaling = zoomExcelPageScaling;
conversionOptions.PageScaling = excelPageScaling;
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx",conversionOptions);
//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
}
ZoomExcelPageScaling(Int32)
Initializes a new instance of the ZoomExcelPageScaling class.
public ZoomExcelPageScaling(int zoomPercentage)
Public Sub New (zoomPercentage As Integer)
Parameters
- zoomPercentage: Int32
Licensing Info
This constructor is a DynamicPDF Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
Examples
Example shows how to use ZoomExcelPageScaling with ZoomPercentage as parameter.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Create new instance of conversionOptions.
Dim conversionOptions As ExcelConversionOptions = New ExcelConversionOptions(ExcelPageSize.A4,10,10)
Dim zoomExcelPageScaling As ZoomExcelPageScaling = New ZoomExcelPageScaling(50)
Dim excelPageScaling As ExcelPageScaling = New ExcelPageScaling()
excelPageScaling.ZoomExcelPageScaling = zoomExcelPageScaling
conversionOptions.PageScaling = excelPageScaling
' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx",conversionOptions)
' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")
End Sub
End Module
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
//Create new instance of conversionOptions.
ExcelConversionOptions conversionOptions = new ExcelConversionOptions(ExcelPageSize.A4,10,10);
ZoomExcelPageScaling zoomExcelPageScaling = new ZoomExcelPageScaling(50);
ExcelPageScaling excelPageScaling = new ExcelPageScaling();
excelPageScaling.ZoomExcelPageScaling = zoomExcelPageScaling;
conversionOptions.PageScaling = excelPageScaling;
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx",conversionOptions);
//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
}
ZoomExcelPageScaling(ZoomExcelPageScaling)
Initializes a new instance of the ZoomExcelPageScaling class.
public ZoomExcelPageScaling(ZoomExcelPageScaling zoomExcelPageScaling)
Public Sub New (zoomExcelPageScaling As ZoomExcelPageScaling)
Parameters
- zoomExcelPageScaling: ZoomExcelPageScaling
Licensing Info
This constructor is a DynamicPDF Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
Examples
Example shows how to use ZoomPercentage property class.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Create new instance of conversionOptions.
Dim conversionOptions As ExcelConversionOptions = New ExcelConversionOptions(ExcelPageSize.A4,10,10)
Dim zoomExcelPageScaling As ZoomExcelPageScaling = New ZoomExcelPageScaling()
zoomExcelPageScaling.ZoomPercentage=50
Dim excelPageScaling As ExcelPageScaling = New ExcelPageScaling()
excelPageScaling.ZoomExcelPageScaling = zoomExcelPageScaling
conversionOptions.PageScaling = excelPageScaling
' Create new instance of Converter by providing suitable parameters.
Dim excelConversion As ExcelConverter = New ExcelConverter("C:\MyDocument.xlsx",conversionOptions)
' Call Convert method to start conversion
excelConversion.Convert("C:\MyOutput.pdf")
End Sub
End Module
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
//Create new instance of conversionOptions.
ExcelConversionOptions conversionOptions = new ExcelConversionOptions(ExcelPageSize.A4,10,10);
ZoomExcelPageScaling zoomExcelPageScaling = new ZoomExcelPageScaling();
zoomExcelPageScaling.ZoomPercentage=50;
ExcelPageScaling excelPageScaling = new ExcelPageScaling();
excelPageScaling.ZoomExcelPageScaling = zoomExcelPageScaling;
conversionOptions.PageScaling = excelPageScaling;
// Create new instance of Converter by providing suitable parameters.
ExcelConverter excelConverter = new ExcelConverter(@"C:\MyDocument.xlsx",conversionOptions);
//Call Convert method to start conversion
excelConverter.Convert(@"C:\MyOutput.pdf");
}
}
Properties
DefaultZoomPercentage
Returns or sets defaults percentage to Microsoft Excel WorkSheets.
public bool DefaultZoomPercentage { get; set; }
Public Property DefaultZoomPercentage As Boolean
Property Value
Licensing Info
This property is a DynamicPDF Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
Examples
This example shows how to provide the worksheets default zoom
Module Module1
Sub Main()
Dim xlOptions As New ExcelConversionOptions(ExcelPageSize.Folio, 18.0, 24.0)
xlOptions.PageScaling = New ExcelPageScaling()
xlOptions.PageScaling.ZoomExcelPageScaling = New ZoomExcelPageScaling(75)
xlOptions.PageScaling.ZoomExcelPageScaling.DefaultZoomPercentage = True
Dim xlConverter As New ExcelConverter("C:\\Document.xls")
xlConverter.ConversionOptions = xlOptions
xlConverter.Convert("outputPDF.pdf")
End Sub
End Module
public class Program
{
static void Main()
{
ExcelConversionOptions xlOptions = new ExcelConversionOptions(false);
ExcelConversion xlConverter = new ExcelConverter("C:\\Document.xls");
xlOptions.PageScaling = new ExcelPageScaling();
xlOptions.PageScaling.ZoomExcelPageScaling = new ZoomExcelPageScaling(75);
xlOptions.PageScaling.ZoomExcelPageScaling.DefaultZoomPercentage = true;
xlConverter.ConversionOptions = xlOptions;
xlConverter.Convert("outputPdf.pdf");
}
}
ZoomPercentage
Returns or sets a percentage (between 10 and 400 percent) will scale the worksheet for printing. Applies only to worksheets.
public int ZoomPercentage { get; set; }
Public Property ZoomPercentage As Int32
Property Value
Licensing Info
This property is a DynamicPDF Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
Examples
This example shows how to provide Zoom for the worksheets.
Module Module1
Sub Main()
Dim xlOptions As New ExcelConversionOptions(ExcelPageSize.Folio, 18.0, 24.0)
xlOptions.PageScaling = New ExcelPageScaling()
xlOptions.PageScaling.ZoomExcelPageScaling = New ZoomExcelPageScaling(75)
Dim xlConverter As New ExcelConverter("C:\\Document.xls")
xlConverter.ConversionOptions = xlOptions
xlConverter.Convert("outputPDF.pdf")
End Sub
End Module
public class Program
{
static void Main()
{
ExcelConversionOptions xlOptions = new ExcelConversionOptions(false);
ExcelConversion xlConverter = new ExcelConverter("C:\\Document.xls");
xlOptions.PageScaling = new ExcelPageScaling()
xlOptions.PageScaling.ZoomExcelPageScaling = new ZoomExcelPageScaling(75)
xlConverter.ConversionOptions = xlOptions;
xlConverter.Convert("outputPdf.pdf");
}
}
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 Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.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 Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.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 Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.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 Converter 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 Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.