Asp.net mvc Asp.Net核心简体中文字符未显示正确的PDF导出(本地化、全球化)

Asp.net mvc Asp.Net核心简体中文字符未显示正确的PDF导出(本地化、全球化),asp.net-mvc,pdf,localization,globalization,viewbag,Asp.net Mvc,Pdf,Localization,Globalization,Viewbag,我在PDF导出上显示特殊字符时遇到问题,但在查看页面本身的翻译方面似乎存在问题 下图显示右上角的html表格未正确翻译为中文。但是,html表下面的数据表可以正确导出。这是在字体系列中添加“Arial Unicode MS”和“Arial Unicode MS Bold”之后出现的 Html表格代码 <div> <table class="refRangeTable"> <tr>

我在PDF导出上显示特殊字符时遇到问题,但在查看页面本身的翻译方面似乎存在问题

下图显示右上角的html表格未正确翻译为中文。但是,html表下面的数据表可以正确导出。这是在字体系列中添加“Arial Unicode MS”和“Arial Unicode MS Bold”之后出现的

Html表格代码

<div>
            <table class="refRangeTable">
                <tr>
                    <th>@Html.Raw((ViewBag.Translations["CatalogueNumber"]))</th>
                    <th>@Html.Raw((ViewBag.Translations["LotNumber"] ))</th>
                    <th>@Html.Raw((ViewBag.Translations["Size"]))</th>
                    <th>@Html.Raw((ViewBag.Translations["Expiry"] ))</th>
                </tr>
                <tr>
                    <td width="150px"><strong>#: viewModel.CatalogueNumber #</strong></td>
                    <td width="100px"><strong>#: viewModel.LotNumber #</strong></td>
                    <td width="100px"><strong>#: viewModel.Size #</strong></td>
                    <td width="150px"><strong>#: viewModel.ExpiryDate #</strong></td>
                </tr>
            </table>
</div>

@Html.Raw((ViewBag.Translations[“catalogenumber”]))
@Html.Raw((ViewBag.Translations[“LotNumber”]))
@Html.Raw((ViewBag.Translations[“Size”]))
@Html.Raw((ViewBag.Translations[“expiration”]))
:viewModel.catalogenumber
:viewModel.LotNumber
#:视图模型。大小#
:viewModel.ExpiryDate

如果需要更多的细节,我们将不胜感激。我很乐意提供。。谢谢

问题已解决

为了解决这个问题,我安装了Arial Unicode MS粗体字体,并删除了强标记html引用

我现在使用CSS类而不是strong标记,示例如下:

CSS

@font-face {
   font-family: "Arial Unicode MS";
   src: url("../Localisation/Fonts/ARIALUNI.TTF") format("truetype");
}

@font-face {
   font-family: "Arial Unicode MS Bold";
   src: url("../Localisation/Fonts/Arial-Unicode-Bold.ttf") format("truetype");
}


.boldPdfExport {
   font-family: "Arial Unicode MS Bold" !important;
}
HTML

<div>
        <table class="refRangeTable">
            <tr>
                <th>@Html.Raw((ViewBag.Translations["CatalogueNumber"]))</th>
            </tr>
            <tr>
                <td width="150px" class="boldPdfExport"> #: viewModel.CatalogueNumber #</td>
            </tr>
        </table>
</div>

@Html.Raw((ViewBag.Translations[“catalogenumber”]))
#:viewModel.catalogenumber#