I need to write Russian text in a pdf document. I found the tip how to do this on the forum. The author advises to see the example https://github.com/datalogics/adobe-pdf-library-samples/blob/master/CPlusPlus/Sample_Source/Text/Uni.... I downloaded this example to my computer, but I was not able to build it. The code contains references to some methods (for example, PDETextAddASText) which are not found in the standard Acrobat API. Tell me, please, how to build examples from the site above? Where can I download libraries and header files for assembly?
This method is part of the Acrobat plug-in API, and is available to plug-ins. HOWEVER, PDF libary is a separate product which must be licensed from Datalogics before you can use it. Expect a negotiation of fees and royalties.
I was in error. https://dev.datalogics.com/adobe-pdf-library/adobe-pdf-library-c-language-interface/additional-apis-... says that PDETextAddASText is a new method created by DataLogics and only available with their library. Adding Unicode (non Latin1) text without it is much more complicated.
Do you have examples or links on how to add text without using the PDETextAddASText method?
Sadly, no. I found this to be a complex and difficult task requiring detailed knowledge of fonts both in PDF and on the OS platform. A commercial project, I cannot share anything from it.
In the Adobe API, there is a PDETextItemReplaceText method, one of the parameters of which is a link to the replaced text. I tried using this method to replace the text. Set this parameter to (Uns8 *) "111", but in the document this text was displayed incorrectly. What have I done wrong? Maybe you need to somehow convert this text before passing it to a method, as a parameter? Unfortunately, I did not find any examples of working with this method.
In every case the string you pass must be in an encoding that matches the encoding for the font object. This is the source of most of the complication in adding or replacing text.
I can get the current font for the replaced object:
PDEFont pdeFontCur = PDETextGetFont (pdeTextCur, kPDETextRun, 0);
But how to encode the replacement text in an encoding that matches the encoding for the font object?
Can you show some example of working with this method?
Sorry, no I cannot show any example code. As I have said, this needs deep study.