Hello Podofo Users,
I'm want to add a small text disclaimer to the first page of a document:
// Set page disclaimer
PdfPainter pdfPainter;
PdfFont* pFont = m_pDocument->CreateFont("Arial");
PdfPage* pPage = m_pDocument->GetPage(0);
pdfPainter.SetPage( pPage );
pdfPainter.Save();
pdfPainter.SetFont( pFont );
pdfPainter.GetFont()->SetFontSize( PAGE_DISLAIMER_SIZE );
pdfPainter.SetColor( 0.0, 0.0, 0.0 ); // black
PdfRect rect = pPage->GetMediaBox();
PoDoFo::PdfString disclaimer_inutf8(reinterpret_cast<const
PoDoFo::pdf_utf8*>(disclaimer.c_str()));
pdfPainter.DrawText( rect.GetLeft(), rect.GetBottom() + rect.GetHeight() -
PAGE_DISLAIMER_SIZE, disclaimer_inutf8 );
pdfPainter.Restore();
pdfPainter.FinishPage();
The code works for normal text, but it fails to draw unicode characters.
I consulted the corresponding test code and saw that there's a unicode font
used:
PdfFont* pFont = m_pDocument->CreateFont("Arial MS Unicode");
Unfortunately, I get a NULL pointer from this call. Is there anything I can
do except downloading a font,
because this is not an option, the code should work without installing
additional things.
Thanks in advance
F.E.
------------------------------------------------------------------------------
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