网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

podofo 中文乱码

时间:2024-11-12 23:03:13

1、为了方便,在文件头中加入这个预编译宏,表示把所有的字符当成utf8编码#if defined(_MSC_VER) && (_MSC_VER >= 1600)# pragma execution_character_set("utf-8")#endif

podofo 中文乱码

3、告诉垓矗梅硗 PdfString 将字符串当成utf8编码解析double w = pPage->GetPageS足毂忍珩ize().GetWidth(); double h = pPage->GetPageSize().GetHeight(); painter.DrawText( 10, 10, "Hello World!" ); PdfString str((pdf_utf8* )"测试podofo显示中文文本显示是否为乱码! \n \n"); painter.DrawMultiLineText( 0, 0, w, h, str);

podofo 中文乱码

5、将上面的锾哩菸谷全部代码段写入到源码中去const PdfEncoding* pp = PdfEncodingFactory::GlobalIdentityEncodingInstance(); PdfFont* pFont = document.CreateFont("SimHei", true, true, false, pp);//Helvetica painter.SetFont( pFont ); double w = pPage->GetPageSize().GetWidth(); double h = pPage->GetPageSize().GetHeight(); painter.DrawText( 10, 10, "Hello World!" ); PdfString str((pdf_utf8* )"测试podofo显示中文文本显示是否为乱码! \n \n"); painter.DrawMultiLineText( 0, 0, w, h, str);

podofo 中文乱码
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com