ExcelWorksheetConversionOptions.RightMargin Property

manages right margin of the page

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

Property Value

Nullable<double>

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
        }
     }
}

See Also

ExcelWorksheetConversionOptions
ceTe.DynamicPDF.Conversion

In this topic