Highlighted

How to write Russian text to a document

Jan 28, 2020

Copy link to clipboard

Copied

Hi,

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?
Thanks.

Topics

Acrobat SDK and JavaScript

Views

116

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to write Russian text to a document

Jan 28, 2020

Copy link to clipboard

Copied

Hi,

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?
Thanks.

Topics

Acrobat SDK and JavaScript

Views

117

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Jan 28, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
Jan 28, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 28, 2020

Copy link to clipboard

Copied

Do you have examples or links on how to add text without using the PDETextAddASText method?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
Jan 28, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 29, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
Jan 29, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 29, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 29, 2020

Copy link to clipboard

Copied

Can you show some example of working with this method?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
Jan 29, 2020

Copy link to clipboard

Copied

Sorry, no I cannot show any example code. As I have said, this needs deep study.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Resources
One Stop Solution for Acrobat
Edit a PDF
Add a group