On Tuesday 21 of July 2009 16:59:58 you wrote: > On Tue, 2009-07-21 at 10:45 +0200, Vincent den Boer wrote: > > Hello everyone, > > > > I'm planning to use PoDoFo. I looked through the API docs and everything > > I need is supported. I also read that the library is Unicode compatible. > > The only problem is that I have little knowledge of Unicode and C++ since > > I normally have other libraries deal with encoding issues. I need to read > > some text from a UTF-8 encoded file and display it in a PDF document. > > Could anyone please give me some pointers on how to do that? > > PoDoFo works with utf8 and UTF16BE unicode data in most places where it > matters. You should be able to feed your UTF-8 encoded text straight > into (eg) PdfString. >
I'm experimenting with the PoDoFo tutorial. I have these lines: std::string test; // This contains the string ěščřžáéëéèäáà std::cout << test << std::endl; painter.DrawMultiLineText( 0, pPage->GetPageSize().GetHeight() - 50, 500, 50, PdfString(test)); The first line outputs the correct string. The second however, output a lot of garbage to the PDF. In the docs I see the PdfDocument takes a PdfEncoding as parameter. I'm guessing that I should pass the UTF8 encoding there. The only thing is that I can't find the right way to get the encoding object. It looks like PdfEncodingFactory::CreateEncoding might be what I'm searching for but I don't know what to pass to it... Could anyone give me some pointers? > If all you need to do is create new PDF files, though, there are > alternatives that you might find a better fit for your needs than > PoDoFo. PoDoFo is low level and rather capable in terms of being able to > parse/edit/write PDF, but you need to know a bit about PDF to get the > best out of it. If it'll do what you need, then great. I'd suggest > looking at Cairo <http://cairographics.org/> too, though, as it's > potentially a very good option that's rather easy to use for simple PDF > output. I chose PoDoFo because the API looked simple enough for me and all the features I need are there (including Unicode which is the reason I'm switching from libHaru). I've looked at Cairo but it looks to me that it's too hard to set up on Windows (I mainly work on Linux but I sometimes have to use Windows too). -- Met vriendelijke groet, Kind regards, Vincent den Boer -- E: [email protected] W: www.shishkabab.net - Open source with a good taste. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users
