Aspose.Pdf 添加水印 发布docker上提示Font Arial was not found

{var param=new PdfAddWaterMarkParam{
WaterMark=“我是水印文字”,
Typeface=“KaiTi”
};
var pdfDoc = new Aspose.Pdf.Document(stream);
var fonts = pdfDoc.FontUtilities.GetAllFonts();

        var fontStr = new StringBuilder();
        foreach (var f in fonts)
        {
            fontStr.Append(f.FontName + "\n");
        }
        Logger.Error($"获取水印字体:{fontStr}");
        var font = Aspose.Pdf.Text.FontRepository.FindFont(param.Typeface);
        var textState = new TextState
        {
            FontSize = param.FontSize,
            ForegroundColor = param.AsposeFontColor,
            Font = font
        };
        Logger.Error($"水印字体类型:{font.FontName}||水印文字:{param.WaterMark}");
        for (int i = 1; i <= pdfDoc.Pages.Count; i++)
        {
            WatermarkArtifact artifact = new();
            artifact.SetTextAndState(param.WaterMark, textState);
            artifact.Rotation = param.Rotation;
            artifact.Opacity = param.FillOpacity;
            artifact.IsBackground = false;
            artifact.ArtifactHorizontalAlignment = HorizontalAlignment.Left;
            artifact.ArtifactVerticalAlignment = VerticalAlignment.Top;
        }

        // 保存文件
        var ms = new MemoryStream();
        pdfDoc.Save(ms);
        ms.Seek(0, SeekOrigin.Begin);
        public class PdfAddWaterMarkParam
        {
            public string Typeface { get; set; }
            public string WaterMark { get; }
        }

}
异常如下:
image.png (9.1 KB)

看日志是执行到: artifact.SetTextAndState(param.WaterMark, textState);

@oyaspose
Yes, the library needs this font, but Docker doesn’t have it by default. The best option for you is the following
image.png (7.9 KB)

To work on Linux, it is recommended to use the Aspose.Pdf.Drawing library (not Aspose.Pdf)

是Aspose的库本身就依赖Arial这个字体么?比较我代码中并没有使用到这个Arial字体。

@oyaspose
In your case this font is used to add the Evaluation mark. The development team is aware of this issue and is working on it.

@oyaspose
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): PDFNET-55872

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.

The issues you have found earlier (filed as PDFNET-55872) have been fixed in Aspose.PDF for .NET 23.12.