I am getting PdfError at "PdfString str1( ar.c_str() );": PoDoFo encountered an error. Error: 8 ePdfError_InternalLogic Error Description: An internal error occurred. Callstack: #0 Error Source: podofo/base/PdfString.cpp:171
My guess is that in order to join these characters you would need to do kerning (https://en.wikipedia.org/wiki/Kerning) or use ligatures/alternates (https://en.wikipedia.org/wiki/Orthographic_ligature). From my observation podofo does not support these things: https://sourceforge.net/p/podofo/mailman/message/36260915/ https://sourceforge.net/p/podofo/mailman/message/36683139/ >From what I googled indicates that seems truetype fonts do not support ligatures but opentype fonts do support them. And seems podofo does not support opentype fonts (also from my experience regarding font subsetting): https://sourceforge.net/p/podofo/mailman/message/21215446/ On Mon, Nov 18, 2019 at 8:50 AM Anand Ramasamy <ramasam...@hcl.com> wrote: > Dear All, > > > > Thanks in advance for the help. > > > > We are facing an issue with Arabic characters when using Podofo library to > draw it in PDF file. > > > > The characters are not joined together in the output pdf file. > > Below is the code that we have implemented to draw Arabic characters in > PDF file. > > > > Attached the expected output and actual output snapshots. > > > > Kindly let us know whether any other settings needs to be enabled or > should we use any other API. > > > > ... > > pFont = document->CreateFont("Arabic Typesetting", false, false, false, > PdfEncodingFactory::GlobalIdentityEncodingInstance(), > PoDoFo::PdfFontCache::eFontCreationFlags_None); > > painter.SetFont(pFont); > > ... > > wstring ar = L"ابناء الشيخ"; > > std::reverse(ar.begin(), ar.end()); > > PdfString str1( ar.c_str() ); > > PdfString pString = str1.ToUnicode(); > > > > painter.AddText(pString, pString.GetCharacterLength()); > > ... > > > > Below are our observations regarding this issue. > > 1. Value of “pString” in the below line contains individual characters of > the Arabic string “ar”. > > > > “PdfString pString = str1.ToUnicode();” > > > > 2. When “pString” is passed to “AddText” api, the output string written to > PDF document is not joined together. > > Kindly refer to the attached expected output and actual output > screenshots. > > > > Regards, > > Anand. > ::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 >
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users