2017-07-12 6 views
0

Je rencontre un problème avec l'affichage de caractères spéciaux dans une exportation PDF, mais cela semble poser problème avec Translations sur la page View elle-même.Asp.Net Core Les caractères chinois simplifiés ne s'affichent pas correctement Exportation PDF (localisation, globalisation)

L'image ci-dessous montre une table html en haut à droite qui ne se traduit pas correctement en chinois. Cependant, le tableau de données sous la table html s'exporte correctement. Ce fut après avoir ajouté dans la police font-family: "Arial Unicode MS" et "Arial Unicode MS Bold"

pdf_export Html Code de table

<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> 

Toute suggestion serait grandement apprécié si tout plus de détails Je suis heureux de vous fournir sont nécessaires .. Merci

Répondre

0

Problème résolu:

pour se déplacer le problème J'ai installé la police Arial Unicode MS Bold et j'ai supprimé la référence html du tag fort.

J'utilise maintenant une classe CSS au lieu de l'étiquette forte, par exemple ci-dessous:

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>