Hello !

...and happy new year ! (in France these kind of wishes stay legal all through 
january ;-)

I was very interested in this thread : 
http://www.mail-archive.com/[email protected]/msg00881.html
(Though I did not manage to reply on it.)

Did you solve Vincent den Boer problem ?

I am exactly in the same situation (trying to pass pdf_utf8 to DrawText)...

I tried things like that :

PdfString lz_pdfText( (pdf_utf8*) lz_text.data());
mc_painter.DrawText( ld_x, ld_y, lz_pdfText);

--> accentuated characters are replaced by zeroes.

I saw some commented code in the source that seemed to match my needs :

I tested it ( in ../podofo-0.7.0/test/CreationTest/CreationTest.cpp (line 67 to 
79 see below ))...

keeping  "new PdfIdentityEncoding( 0, 0xffff, true )" as encoding parameter of 
doc->CreateFont
--> the returned PdfFont is NULL.

changing it to PdfEncodingFactory::GlobalPdfDocEncodingInstance()
--> accentuated characters are replaced by zeroes.

Thanks in advance !
Regards

Gwen

Commented in CreationTest.cpp :    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( 8.0 );
    pPainter->SetFont( pFont );
    pPainter->DrawText( 100.0, 100.0, sJap );

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to