現在Aspose.PDF for .NETの購入を検討しています。
Aspose.PDFにおいて、5桁のUnicodeを入力し表示させると、
4桁で区切られてしまい意図していない文字に変換されてしまいます。
https://glyphwiki.org/wiki/u20bb7
https://glyphwiki.org/wiki/u20bb
5桁を表示させる方法などありましたら教えていただきたいです。
以下参考ソースです。
string dataDir = new ProcessStartInfo("Aspose.pdf").FileName;
Document document = new Document();
Page page = document.Pages.Add();
Aspose.Pdf.Text.TextFragment fragment = new Aspose.Pdf.Text.TextFragment("");
System.Drawing.Text.InstalledFontCollection ifc = new System.Drawing.Text.InstalledFontCollection();
Aspose.Pdf.Text.TextSegment segment = new Aspose.Pdf.Text.TextSegment();
//TODO:"𠮷"の字を入力したい。
//https://graphemica.com/%F0%A0%AE%B7
segment.Text = "\u20bb7";
Aspose.Pdf.Text.TextState ts = new Aspose.Pdf.Text.TextState();
//フォントフォルダ指定
var fs = new FolderFontSource(System.Environment.GetFolderPath(Environment.SpecialFolder.Fonts));
FontRepository.Sources.Add(fs);
FontRepository.LoadFonts();
//フォント指定
var font = FontRepository.FindFont("MS PGothic", Aspose.Pdf.Text.FontStyles.Regular);
ts.Font = font;
ts.Font.IsEmbedded = true;
//位置指定
fragment.Position = new Position(50, 50);
//文字間指定
float space = 0f;
ts.CharacterSpacing = space;
page.Paragraphs.Add(fragment);
segment.TextState = ts;
fragment.Segments.Add(segment);
// Save updated PDF
document.Save(dataDir);
ProcessStartInfo processStartInfo = new ProcessStartInfo("Aspose.pdf");
processStartInfo.UseShellExecute = true;
Process.Start(processStartInfo);