Hi, There is no support for non-western writing systems. You would need to do it yourself: https://sourceforge.net/p/podofo/mailman/message/36934272/
On Sun, Aug 1, 2021 at 1:53 PM ning <ningning...@foxmail.com> wrote: > Deatr podofoteams: > > I recently used podofo to add text to the PDF, but found that the correct > Chinese cannot be added to the PDF under linux (ubuntu). The code I used is > the following paragraph: > > * pFont = pDocument->CreateFont( "Arial Unicode MS", new > PdfIdentityEncoding( 0, 0xffff, true ) );* > * printf("GOT: %s\n", pFont->GetFontMetrics()->GetFontname() );* > * PdfString sJap(reinterpret_cast<const pdf_utf8*>("「Po\tDoFo」中文测试"));* > * const long lUtf8BufferLen = 256;* > * pdf_utf8 pUtf8Buffer[lUtf8BufferLen];* > > > * PdfString::ConvertUTF16toUTF8( sJap.GetUnicode(), > sJap.GetUnicodeLength(), pUtf8Buffer, lUtf8BufferLen );* > * printf("UNIC: %s\n", pUtf8Buffer );* > > * pFont->SetFontSize( 18.0 );* > * pPainter->SetFont( pFont );* > * pPainter->DrawText( 100.0, 100.0, sJap );* > > In addition to this, I also used > > *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();* > > *PdfString str((pdf_utf8* )"测试podofo显示中文文本显示是否为乱码! \n \n");* > > *painter.DrawMultiLineText( 0, 0, w, h, str);* > > > After I use this code, I cannot find these words in the PDF, so I seek > your help and hope to get a reply, thank you > > best wishes > ning > _______________________________________________ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users >
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users