menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum AspectRatio - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Enum AspectRatio

    Specifies the primary dimension of the output image.

    Namespace: Syncfusion.HtmlConverter
    Assembly: Syncfusion.HtmlConverter.Base.dll
    Syntax
    public enum AspectRatio
    Examples
    //Initialize HTML to PDF converter
    HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.IE);
    //Initialize the IE converter settings
    IEConverterSettings ieSettings = new IEConverterSettings();
    //Set AspectRatio
    ieSettings.AspectRatio = AspectRatio.None;
    //Assign IE settings to HTML converter
    htmlConverter.ConverterSettings = ieSettings;
    //Convert URL to PDF
    PdfDocument document = htmlConverter.Convert("https://www.google.com");
    //Save the document.
    document.Save("Sample.pdf");
    document.Close();
    'Initialize HTML to PDF converter
    Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.IE)
    'Initialize the IE converter settings
    Dim ieSettings As New IEConverterSettings()
    'Set AspectRatio
    ieSettings.AspectRatio = AspectRatio.None
    'Assign IE settings to HTML converter
    htmlConverter.ConverterSettings = ieSettings
    'Convert URL to PDF
    Dim document As PdfDocument = htmlConverter.Convert("https://www.google.com")
    'Save the document.
    document.Save("Sample.pdf")
    document.Close()

    Fields

    Name Description
    FitPageSize

    keep the width and height.

    KeepHeight

    Keep height fixed and proportionally change width of the image.

    KeepWidth

    Keep width fixed and proportionally change height of the image.

    None

    Don't apply keeping of aspect ratio.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved