对不起,我的英语,我对 PDF 中的西里尔符号有疑问。我在 Windows 和 Linux 中使用 PoDoFo 库版本 0.9.7 和 fontconfig。
PdfMemDocument document;
document.Load("anyfile.pdf", true);
/***/
PdfFont *fontPtr = fontPtr = document.CreateFont("Arial", false, false, PdfEncodingFactory::GlobalIdentityEncodingInstance());
PdfPainter painter;
painter.SetPage(document.GetPage(0));
/***/
PdfString str(reinterpret_cast<const pdf_utf8*>("Next text is russian words: 'Пример текста на русском.'"));
// i use plog loging lib and it:
// LOG_INFO << str.GetStringUtf8(); // out correct string
/***/
painter.DrawTextAligned(40, 400, 800, str.GetStringUtf8(), PoDoFo::EPdfAlignment::ePdfAlignment_Left);
painter.FinishPage();
document.Close();
我看到它是波兰语的页面,但对我没有帮助!
在屏幕截图上给出了我的例子: