Hi

Which OS are you using?(assuming the latest podfo is being used)
Do you have "Arial MS Unicode" installed in your system?
If “Arial MS Unicode” is not installed please use some other font, which 
supports all Unicode characters. Also please set the encoding to identity 
encoding.

Regards
Ali
From: F. E. [mailto:exler7...@gmail.com]
Sent: 18 June 2017 23:03
To: podofo-users@lists.sourceforge.net
Subject: [Podofo-users] DrawText & Unicode

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.


::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information 
could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in 
transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on 
the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the 
author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written 
consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please 
delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and 
other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
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