Hi,
we noticed some characters are missing in HTML output which are in italic style. Scenario happens in Linux / Docker.
Reproducable with the following setup:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspose.Words" Version="25.9.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.0" />
</ItemGroup>
</Project>
// See https://aka.ms/new-console-template for more information
using Aspose.Words;
using Aspose.Words.Saving;
var lic = new License();
lic.SetLicense(@"./data/Aspose.Total.NET.lic");
var externalFontSource = new Aspose.Words.Fonts.FolderFontSource(@"./fonts/", true);
var systemFontSource =
new Aspose.Words.Fonts.FolderFontSource(Environment.GetFolderPath(Environment.SpecialFolder.Fonts),
true);
// Sammeln der Font-Quellen
var fontSources =
new List<Aspose.Words.Fonts.FontSourceBase>(Aspose.Words.Fonts.FontSettings.DefaultInstance
.GetFontsSources())
{
// Hinzufügen der eigenen Font-Quellen
externalFontSource,
systemFontSource
};
// Anwenden der neuen Font-Einstellungen
Aspose.Words.Fonts.FontSettings.DefaultInstance.SetFontsSources(fontSources.ToArray());
var doc = new Document(@"./data/in.docx");
var htmlOptions = new HtmlFixedSaveOptions();
htmlOptions.CssClassNamesPrefix = "cs-words";
htmlOptions.ExportEmbeddedCss = true;
htmlOptions.ExportEmbeddedFonts = true;
htmlOptions.ExportEmbeddedImages = true;
htmlOptions.ExportEmbeddedSvg = true;
htmlOptions.SaveFormat = SaveFormat.HtmlFixed;
htmlOptions.UseAntiAliasing = true;
// IMS-16349 Workaround; fixed with WORDSNET-23460 / WORDSNET-26109 through IMS-29035
// htmlOptions.MetafileRenderingOptions.RenderingMode = MetafileRenderingMode.Bitmap;
using (var stream = new FileStream(@"./data/out.html", FileMode.Create))
{
doc.Save(stream, htmlOptions);
}
Console.WriteLine("FINISH");
# Unter https://aka.ms/customizecontainer erfahren Sie, wie Sie Ihren Debugcontainer anpassen und wie Visual Studio dieses Dockerfile verwendet, um Ihre Images für ein schnelleres Debuggen zu erstellen.
# Diese Stufe wird verwendet, wenn sie von VS im Schnellmodus ausgeführt wird (Standardeinstellung für Debugkonfiguration).
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
WORKDIR /app
# Diese Stufe wird zum Erstellen des Dienstprojekts verwendet.
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["ConsoleApp2/ConsoleApp2.csproj", "ConsoleApp2/"]
RUN dotnet restore "./ConsoleApp2/ConsoleApp2.csproj"
COPY . .
WORKDIR "/src/ConsoleApp2"
RUN dotnet build "./ConsoleApp2.csproj" -c $BUILD_CONFIGURATION -o /app/build
# Diese Stufe wird verwendet, um das Dienstprojekt zu veröffentlichen, das in die letzte Phase kopiert werden soll.
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./ConsoleApp2.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# Diese Stufe wird in der Produktion oder bei Ausführung von VS im regulären Modus verwendet (Standard, wenn die Debugkonfiguration nicht verwendet wird).
FROM base AS final
WORKDIR /app
#Include contrib archive to install windows fonts. Must run before package update
RUN sed -i 's/^Components: main$/& contrib/' /etc/apt/sources.list.d/debian.sources
#Installs "windows fonts"
RUN apt-get update && apt-get install -y ttf-mscorefonts-installer fontconfig
#SkiaSharp dependency of Aspose requires libfontconfig1. See Aspose documentation for this.
RUN apt-get update && apt-get install -y libfontconfig1
#ICU for Culture Information
RUN apt-get update && apt-get install -y libicu-dev
USER $APP_UID
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ConsoleApp2.dll"]
Run command:
docker run --rm -it -v C:\Fonts:/app/fonts -v D:\tmp:/app/data consoleapp2:latest
Fonts folder is a copy of WIndows Server Fonts folder + few customer speicfic fonts.
Test files (i inlcuded my output):
example.zip (363.2 KB)
You can see there are missing symbols on Page 3
Our customer mentioned they have that same behaviour in multiple documents with italic fonts and that we can hand out that one document as sample but has to be deleted after analysis / fixing.
Thanks for oyur help.