Hi,
I sent my previois answer only to zyx, sry.
Anyway, if I do this:

        PdfString pLtext(reinterpret_cast<const pdf_utf8*>("Łódź stół"));
It gives me 
        „Unhandled exception at 0x75ECA882 in fvu.exe: Microsoft C++ exception: 
PoDoFo::PdfError at memory location 0x006FF6E0.”
But when I do this:
        PdfString pLtext(L"Łódź stół");
It goes smoothly, and I got polish chars in pdf file.
I got no idea why it works, but it seems you just need to use wchar_t* to 
construct PdfString and it works.
All:
        PdfString pLtext(L"Łódź stół");
        PdfFont* pFont = document.CreateFont("TIMES NEW ROMAN", false, new 
PdfIdentityEncoding(0, 0xffff, true));


        painter.SetFont(pFont);
        painter.DrawText(100.0, page->GetPageSize().GetHeight() - 100.0, 
pLtext);

This line is important as well:
        PdfFont* pFont = document.CreateFont("TIMES NEW ROMAN", false, new 
PdfIdentityEncoding(0, 0xffff, true));

In the end, I’d like to ask, where can I find list of fonts which supports 
polish chars.
If I create ”TIMES NE ROMAN” font, it works, but with ”Times-Roman” from 
base14, it doesn’t.
Thanks for help.

Best regards, 
Fryderyk

Od: zyx
Wysłano: piątek, 24 marca 2017 19:43
Do: podofo-users@lists.sourceforge.net
Temat: Re: [Podofo-users] ODP: polish chars to pdf

On Mon, 2017-03-13 at 21:37 +0100, frydery...@gmail.com wrote:
> Anyone? How to draw wstring with polish characters on pdf file?

        Hi,
maybe follow what's done with 'sJap' here:
https://sourceforge.net/p/podofo/code/HEAD/tree/podofo/trunk/test/CreationTest/CreationTest.cpp#l64

        Bye,
        zyx

-- 
http://www.litePDF.cz                                 i...@litepdf.cz

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to