.net core iText7 pdfHTML c#不';在linux/unix系统上不尊重baseuri

.net core iText7 pdfHTML c#不';在linux/unix系统上不尊重baseuri,.net-core,itext,itext7,.net Core,Itext,Itext7,您好,目前我正在评估IText7,我发现非常惊人,但我发现了一个我相信的错误。在.net core 2.2中使用最新版本pdfHTML 2.1.1设置baseUri以访问本地css和图像在windows中效果良好,但在linux/mac上效果不佳 private byte[] PdfGenerator(string html) { ConverterProperties converterProperties = new ConverterProperties();

您好,目前我正在评估IText7,我发现非常惊人,但我发现了一个我相信的错误。在.net core 2.2中使用最新版本
pdfHTML 2.1.1
设置baseUri以访问本地css和图像在windows中效果良好,但在linux/mac上效果不佳

private byte[] PdfGenerator(string html)
    {
        ConverterProperties converterProperties = new ConverterProperties();
        var basepath = Path.Combine(AppContext.BaseDirectory,"asset");
        _logger.LogDebug($"Base path is :" +basepath);
        converterProperties.SetBaseUri(basepath);
        using (var memStream = new MemoryStream())
        {
            HtmlConverter.ConvertToPdf(html, memStream, converterProperties);
            return memStream.ToArray();
        }
    }
尽管在我的运行目录中,
asset
文件夹下有文件(css、图像) 对于windows和mac,我得到了两种不同的结果

我像这样在我的html中链接css

<link rel="stylesheet" type="text/css" href="css/style.css">

窗口

Mac

basepath
的值为

Mac
/Users/gpapadak/code/In.Backend/src/In.Report.Api/bin/Debug/netcoreapp2.2/asset
Windows
I:\\u github\In.Backend\src\In.Report.Api\bin\Debug\netcoreapp2.2\asset

Linux
/repositories/publish/asset


有什么帮助或解决方法吗?

这里可能有两个问题。文件路径分隔符和路径中的空白字符。请调试您的代码以进行验证。您的
basepath在Windows、Linux和Mac上的具体值是多少?更新了我的问题新年快乐!!!有什么消息吗?