作成日: 2019/07/11 最終更新日: 2024/12/24
文書種別
使用方法
詳細
以下のNuGetパッケージを追加すると、実行環境に登録されている外字をPDFに埋め込むことができます。
※この方法はWindows OSでのみ有効です。
※この方法はWindows OSでのみ有効です。
| V7J (7.0.3) 以降 | DioDocs.Imaging.Windows.ja |
| V5J (5.0.0.767) 以降 | GrapeCity.DioDocs.Imaging.Windows.ja |
| V4J (4.2.0.726) 以前 | GrapeCity.DioDocs.Common.Windows.ja |
UpdateEudcLinksメソッドにnullを渡すとSystemFontCollectionにEUDCのリンクが反映されます。
◆サンプルコード(C#)
// 実行環境のEUDCを読み込む
GrapeCity.Documents.Text.Windows.FontLinkHelper.UpdateEudcLinks(null);
var doc = new GcPdfDocument();
var page = doc.NewPage();
var g = page.Graphics;
var tf = new GrapeCity.Documents.Text.TextFormat()
{
Font = GrapeCity.Documents.Text.FontCollection.SystemFonts.FindFamilyName("MS Gothic"),
FontSize = 20
};
// 外字(0xE000)を描画する
string strEUDC = Convert.ToChar(Convert.ToInt32("E000", 16)).ToString();
g.DrawString(strEUDC, tf, new PointF(72, 72));
doc.Save("eudc.pdf");
◆サンプルコード(VB.NET)
' 実行環境のEUDCを読み込む
GrapeCity.Documents.Text.Windows.FontLinkHelper.UpdateEudcLinks(Nothing)
Dim doc As New GcPdfDocument()
Dim Page = doc.NewPage()
Dim g = Page.Graphics
Dim tf As New GrapeCity.Documents.Text.TextFormat() With
{
.Font = GrapeCity.Documents.Text.FontCollection.SystemFonts.FindFamilyName("MS Gothic"),
.FontSize = 20
}
' 外字(0xE000)を描画する
Dim strEUDC As String = Convert.ToChar(Convert.ToInt32("E000", 16)).ToString()
g.DrawString(strEUDC, tf, New PointF(72, 72))
doc.Save("eudc.pdf")
関連情報
旧文書番号
84234