Hi

It seems to be a problem when identity encoding is used.

Can you try with
pFont = document.CreateFontSubset("SimHei", false,false,false, 
(PdfEncoding*)encoding);

Regards
Ali

From: liben...@zhongfu.net [mailto:liben...@zhongfu.net]
Sent: Wednesday, November 16, 2016 5:48 PM
To: podofo-users <podofo-users@lists.sourceforge.net>
Subject: [Podofo-users] Pdf displays not correct

hi,all:
    I have some sample code, but  it seems not  work properly.
    The spacing between letters is larger than the normal word.
    It seems that a English letter takes up two positions. But the chinese 
words displays correctly.
    I have worked four days on this problem, but the problem is still not 
solved.

    PdfStreamedDocument document( "hello-pdf.pdf" );
    PdfPainter painter;
    PdfPage* pPage;
    PdfFont* pFont;
    pPage = document.CreatePage( PdfPage::CreateStandardPageSize( 
ePdfPageSize_A4 ) );
    painter.SetPage( pPage );

    PdfIdentityEncoding *encoding = new PdfIdentityEncoding(0,0xffff,false);
    pFont = document.CreateFont( "SimHei", false, (PdfEncoding*)encoding);
    //pFont = document.CreateFont( "SimHei");
    pFont->SetFontSize( 18.0 );
    painter.SetFont( pFont );

    painter.DrawText( 56.69, pPage->GetPageSize().GetHeight() - 56.69, "Hello 
World!" );

    painter.DrawText( 56.69, pPage->GetPageSize().GetHeight() - 56.69- 26.69, 
PdfString( reinterpret_cast<const pdf_utf8*>("你好")) );

    painter.FinishPage();
    document.Close();

could someone help me?
sorry for my poor English.
best wishes!



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

----------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to