我有一些RTF文本從我的C#應用程序,我轉換爲HTML,然後發送到我的PHP文件。 問題是;我在PHP中的所有文本都是Arial,我的RTF的輸出是Tahoma。任何想法如何改變字體家族?RTF到HTML,更改字體家族
這是我到目前爲止的代碼:
string memoValue = inboundSet.Fields["MEMO"].Value.ToString();
if (RtfTags.IsRtfContent(memoValue))
{
using (RichEditDocumentServer richServer = new RichEditDocumentServer())
{
string htmlText = string.Empty;
richServer.RtfText = memoValue;
htmlText = richServer.HtmlText;
callDetail.Memo = htmlText;
}
}
else
{
callDetail.Memo = memoValue;
}
在我的PHP文件,我用這種方式獲得的價值:
echo "<td>Memo:</td><td>".$value->Memo."</td>";
我也嘗試了這種方式:
echo "<td>Memo:</td><td class='fonttest'>".$value->Memo."</td>";
而在我的CSS中:
.fonttest
{
font-size:12px;
font-family:Arial;
}
我的文字一直在尋找這樣的:
這是我的RTF文本是什麼樣子:
你有沒有試圖改變'時代新Roman'和'Calibri'爲'Arial' ?只是一個簡單的事情,我需要問:) –
我已經解決了它。我無法手動更改RTF,因爲我沒有直接訪問C#應用程序的代碼 – Matheno