menu

WPF

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

    Show / Hide Table of Contents

    Enum MediaType

    Specifies the media type of WebKit converter

    Namespace: Syncfusion.HtmlConverter
    Assembly: Syncfusion.HtmlConverter.Base.dll
    Syntax
    public enum MediaType
    Examples
    //Initialize HTML converter with WebKit rendering engine
    HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
    WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
    //Set WebKit path
    webKitSettings.WebKitPath = @"/QtBinaries/"; 
    //Set print media type
    webKitSettings.MediaType = MediaType.Print;
    //Assign WebKit settings to HTML converter
    htmlConverter.ConverterSettings = webKitSettings;
    //Convert URL to PDF
    PdfDocument document = htmlConverter.Convert("https://www.google.com");  
    //Save the document.
    document.Save("Sample.pdf");
    document.Close();
    'Initialize HTML converter with WebKit rendering engine
    Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
    Dim webKitSettings As New WebKitConverterSettings()
    'Set WebKit path
    webKitSettings.WebKitPath = "/QtBinaries/"
    'Set print media type
    webKitSettings.MediaType = MediaType.Print
    'Assign WebKit settings to HTML converter
    htmlConverter.ConverterSettings = webKitSettings
    '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
    Print

    Print media type

    Screen

    Screen media type

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