Aspose.HTML for .NET 20.3 Release Notes

As per the regular monthly update process of all APIs being offered by Aspose, we are honored to announce the March release of Aspose.HTML for .NET. In this release, we have improved the handling of broken fonts and invalid URLs. We have also made some improvements to the rendering process that includes:

  • Handling of the negative table margins
  • Improved JavaScript parsing algorithm
  • Improved PDF document encryption
  • Increased accuracy of the table size calculation algorithm

We have also changed the default behavior of MarkdownSaveOption. Now all the features, defined in the original Markdown documentation, will be enabled by default. This will let you receive appropriate results without the necessity of additional configuration.

Improvements and Changes

KeySummaryCategory
HTMLNET-2436HTML not properly converted to PDFBug
HTMLNET-2452HTML to Image - NullReferenceException OccursBug
HTMLNET-2439Exception during localhost site to image conversionBug
HTMLNET-2461Html to Image conversion hangsBug
HTMLNET-2441Aspose.HTML 20.1 Failed to parse URLBug
HTMLNET-2343Documentation on how Aspose libraries cache user data/files for performanceBug

Public API and Backward Incompatible Changes

The default value of Features property, defined in the MarkdownSaveOptions class, has changed. Now it contains a list of features defined in the original Markdown documentation.

 namespace Aspose.Html.Saving

{

    public class MarkdownSaveOptions : SaveOptions

    {

        public MarkdownFeatures Features { get; set; }

    }

}

Added APIs

We have added new signatures to the EPUB and MHTML converters. Now you can specify an input file using an URL or string path.

 namespace Aspose.Html.Converters

{

    public static class Converter

    {

        /// <summary>

        /// Convert epub source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourcePath">Conversion source path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(string sourcePath, XpsSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(Url sourceUrl, XpsSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(string sourcePath, Configuration configuration, XpsSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(Url sourceUrl, Configuration configuration, XpsSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(string sourcePath, XpsSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(Url sourceUrl, XpsSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(string sourcePath, Configuration configuration, XpsSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(Url sourceUrl, Configuration configuration, XpsSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(string sourcePath, PdfSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(Url sourceUrl, PdfSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(string sourcePath, Configuration configuration, PdfSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(Url sourceUrl, Configuration configuration, PdfSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(string sourcePath, PdfSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(Url sourceUrl, PdfSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(string sourcePath, Configuration configuration, PdfSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(Url sourceUrl, Configuration configuration, PdfSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to image. Result is image file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(string sourcePath, ImageSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to image. Result is image file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(Url sourceUrl, ImageSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to image. Result is image file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(string sourcePath, Configuration configuration, ImageSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to image. Result is image file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertEPUB(Url sourceUrl, Configuration configuration, ImageSaveOptions options, string outputPath);

        /// <summary>

        /// Convert epub source to image. Result is image file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(string sourcePath, ImageSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to image. Result is image file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(Url sourceUrl, ImageSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to image. Result is image file.

        /// </summary>

        /// <param name="sourcePath">Conversion epub source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(string sourcePath, Configuration configuration, ImageSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert epub source to image. Result is image file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertEPUB(Url sourceUrl, Configuration configuration, ImageSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(string sourcePath, XpsSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(Url sourceUrl, XpsSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(string sourcePath, Configuration configuration, XpsSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(Url sourceUrl, Configuration configuration, XpsSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(string sourcePath, XpsSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(Url sourceUrl, XpsSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(string sourcePath, Configuration configuration, XpsSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to xps. Result is xps file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(Url sourceUrl, Configuration configuration, XpsSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(string sourcePath, PdfSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(Url sourceUrl, PdfSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(string sourcePath, Configuration configuration, PdfSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(Url sourceUrl, Configuration configuration, PdfSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(string sourcePath, PdfSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(Url sourceUrl, PdfSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(string sourcePath, Configuration configuration, PdfSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to pdf. Result is pdf file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(Url sourceUrl, Configuration configuration, PdfSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to image. Result is image file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(string sourcePath, ImageSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to image. Result is image file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(Url sourceUrl, ImageSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to image. Result is image file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(string sourcePath, Configuration configuration, ImageSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to image. Result is image file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="outputPath">Output file path.</param>

        public static void ConvertMHTML(Url sourceUrl, Configuration configuration, ImageSaveOptions options, string outputPath);

        /// <summary>

        /// Convert mhtml source to image. Result is image file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(string sourcePath, ImageSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to image. Result is image file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(Url sourceUrl, ImageSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to image. Result is image file.

        /// </summary>

        /// <param name="sourcePath">Conversion mhtml source file path.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(string sourcePath, Configuration configuration, ImageSaveOptions options, ICreateStreamProvider provider);

        /// <summary>

        /// Convert mhtml source to image. Result is image file.

        /// </summary>

        /// <param name="sourceUrl">The source URL.</param>

        /// <param name="configuration">The environment configuration.</param>

        /// <param name="options">Conversion options.</param>

        /// <param name="provider">Implementation of the <see cref="ICreateStreamProvider"/> interface, which will be used to get an output stream.</param>

        public static void ConvertMHTML(Url sourceUrl, Configuration configuration, ImageSaveOptions options, ICreateStreamProvider provider);

    }

}

We have also added the empty constructor to the ImageSaveOptions class.

 namespace Aspose.Html.Saving

{

    public class ImageSaveOptions : ImageRenderingOptions

    {

        /// <summary>

        /// Initializes a new instance of the <see cref="ImageSaveOptions"/> class; <see cref="ImageFormat.Png"/> will be used as default image format.

        /// </summary>

        public ImageSaveOptions();

    }

}