ExcelWorksheetConversionOptions

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

public class ExcelWorksheetConversionOptions
Public Class ExcelWorksheetConversionOptions

Inheritance: ObjectExcelWorksheetConversionOptions

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
ExcelWorksheetConversionOptions(ExcelPageSize, Double)Initializes a new instance of the ExcelWorksheetConversionOptions class
ExcelWorksheetConversionOptions(ExcelPageSize, Double, Double)Initializes a new instance of the ExcelWorksheetConversionOptions class.
ExcelWorksheetConversionOptions(ExcelPageSize, PageOrientation?, Double)Initializes a new instance of the ExcelWorksheetConversionOptions class.
ExcelWorksheetConversionOptions(ExcelPageSize, PageOrientation?, Double, Double)Initializes a new instance of the ExcelWorksheetConversionOptions class.
ExcelWorksheetConversionOptions(ExcelWorksheetConversionOptions)Initializes a new instance of the ExcelWorksheetConversionOptions class

Properties

BottomMarginmanages bottom margin of the page
DefaultToFileUse default options as per the file settings.
LeftMarginmanages left margin of the page
Orientationmanages orientation of the page
PageScalingmanages page scaling
PageSizemanages page size
RightMarginmanages right margin of the page
TopMarginmanages top margin of the page

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.Conversion

In this topic