Aspose.HTML not working with asp.net core bookwarm but working for bullseye. In non working version display font as block

  • Aspose.HTML version 24.1.0
  • Usage in inside docker container

Docker file. ( This create issue.)

FROM mcr.microsoft.com/dotnet/aspnet:6.0-bookworm-slim AS base
RUN apt-get update \
    && apt-get install -y libgdiplus \
    && apt-get install -y libc6-dev \
    && apt-get install -y fonts-liberation \
    && apt-get install -y fonts-crosextra-carlito \
    && apt-get install -y libfreetype6 \
    && apt-get install -y libfontconfig1 \
    && apt-get install -y libgxps-utils \
    && apt-get install -y curl \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
COPY /publish6 /app
WORKDIR /app
EXPOSE 80
ENTRYPOINT ["dotnet", "DockerRelatedCheck.dll"]

Docker file works fine.

FROM mcr.microsoft.com/dotnet/aspnet:6.0.26-bullseye-slim AS base
RUN apt-get update \
    && apt-get install -y libgdiplus \
    && apt-get install -y libc6-dev \
    && apt-get install -y fonts-liberation \
    && apt-get install -y fonts-crosextra-carlito \
    && apt-get install -y libfreetype6 \
    && apt-get install -y libfontconfig1 \
    && apt-get install -y libgxps-utils \
    && apt-get install -y curl \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
COPY /publish6 /app
WORKDIR /app
EXPOSE 80
ENTRYPOINT ["dotnet", "DockerRelatedCheck.dll"]

Following is the sample code.

using System.Reflection;

var builder = WebApplication.CreateBuilder(args);

var app = builder.Build();

app.MapGet("/test", (ILogger<Program> looger) =>
{

    DrawHtmlToTextComponent richTextBoxRenderer = new DrawHtmlToTextComponent();
    var byteArray = richTextBoxRenderer.DrawText();
    return Results.File(byteArray, "image/png");
});

app.Run();

public class DrawHtmlToTextComponent 
{   
    private const float ImageResolutionDpi = 300;
    private const int ImageWidthWithResolution = 1;
    private const int LeftImageMargin = 2;
    private const int TopImageMargin = 1;
    public DrawHtmlToTextComponent()
    {

    }

    public byte[] DrawText()
    {
        var RESOLUTION = 300;

        var richTextBoxHtmlText = "<b> This is test. </b>";

        Aspose.Html.HTMLDocument html_document = new Aspose.Html.HTMLDocument(richTextBoxHtmlText, string.Empty);

        Aspose.Html.Saving.ImageSaveOptions options = new Aspose.Html.Saving.ImageSaveOptions(Aspose.Html.Rendering.Image.ImageFormat.Png);
        options.PageSetup.FirstPage = new Aspose.Html.Drawing.Page()
        {
            Size = new Aspose.Html.Drawing.Size((200 / (RESOLUTION / 96)), 300),
            Margin = new Aspose.Html.Drawing.Margin(0, 0, 0, 0),
        };        
        
        options.HorizontalResolution = ImageResolutionDpi;
        options.VerticalResolution = ImageResolutionDpi;

        Aspose.Html.Converters.Converter.ConvertHTML(html_document, options, "temp.png");

        return System.IO.File.ReadAllBytes("temp.png");        
    }

    private void setAsposeLicence()
    {
        try
        {
            // get the resource name of the Embedded Aspose License File
            string resourceName = Assembly.GetExecutingAssembly()
                .GetManifestResourceNames()
                .Single(str => str.EndsWith("Aspose.Total.lic", StringComparison.InvariantCulture));

            Aspose.Html.License htmlLicence = new Aspose.Html.License();
            htmlLicence.SetLicense(resourceName);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
}

Non working ( Bookwarm )
image.png (1.1 KB)

Working (Bullseye)
image.jpg (26.3 KB)

@jpatciv

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): HTMLNET-5350

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks for raising the request.

As you mention that you have raised the request means it is problematic area.

Thanks.

@jpatciv

We raised this ticket because this area was not investigated before. Therefore, we will try to look into it in more details to determine why such issue has been occurring. We will share our investigation results with you as soon as the ticket is resolved.

1 Like

Is there any update ?

It is surely a issue with bookwarm and specially for ImageDevice. ( Aspose.HTML context)

For other device it seems to be working but definitely it needs to work for image as well like it is working for other.

@jpatciv

The issue is being investigated on at the moment and your concerns have also been recorded along with the ticket. We will surely inform you as soon as we make some progress towards ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi

I have the paid support with Aspose and would request that this be raised with that team.
How to I escalate this please under my account

Thanks in advance

@shibbert79

Please create a new topic in Paid Support forum with the reference to the ticket ID shared here and your ticket will be escalated accordingly to the highest priority.

Thank you for the information
I have raised ticket #177487 to cover this item
Please can it be looked at

Many thanks
Sarah

@shibbert79

We confirm now that the ticket has been escalated accordingly.

@shibbert79

With 24.3 version, we fixed the problem of drawing empty squares instead of symbols under Linux. This problem was related to the problems of the System.Drawing.Common via libgdi+ for a specific Debian version.

Just to be specific that, That square block are actually text.

@jpatciv

Yes, we understand that. We will send you a notification as soon as the 24.3 version is published.

The issues you have found earlier (filed as HTMLNET-5350) have been fixed in this update. This message was posted using Bugs notification tool by avpavlysh