Skip to main content
Vijaykumar L S
Known Participant
May 21, 2018
Answered

Junk Character Display for Some Greek Characters in Acrobat DC

  • May 21, 2018
  • 9 replies
  • 4117 views

Hi,

I want to display Greek characters in the pdf Doc using c++, but after Stamping it shows Junk Character...

I am using PDEText Object to Add text to the pdf doc.

Please anyone Help me..

Thanks...

[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]

[Encore is to create a DVD... moved to Acrobat programming forum... Mod]

This topic has been closed for replies.
Correct answer lrosenth

Here is some sample code for writing Unicode values into a PDF. It shows five different languages.

https://github.com/datalogics/adobe-pdf-library-samples/blob/master/CPlusPlus/Sample_Source/Text/UnicodeText/UnicodeText.cpp

9 replies

Legend
May 23, 2018

Not the HTML code. Please examine YOUR DATA to see what hex code is used. This is about YOUR data, not a magic recipe that will solve this for everyone.

Vijaykumar L S
Known Participant
May 24, 2018

I just convrted my string to Hexadecimal Value.

For "Mu" I get an Hexadecimal value as "B5".

lrosenth
Adobe Employee
lrosenthCorrect answer
Adobe Employee
May 24, 2018

Here is some sample code for writing Unicode values into a PDF. It shows five different languages.

https://github.com/datalogics/adobe-pdf-library-samples/blob/master/CPlusPlus/Sample_Source/Text/UnicodeText/UnicodeText.cpp

Legend
May 23, 2018

No it is not ANSI because there is no mu in ANSI. You have to know this. What hex code is it?

Vijaykumar L S
Known Participant
May 23, 2018

The Hexa value for Mu is;&‌#x03BC

Which Encoding I need to Do...

Vijaykumar L S
Known Participant
May 23, 2018

Please tel me the Steps to Display Exact same character in the PDF Doc...

Thanks...

Legend
May 23, 2018

You never answered my questions about what encoding you have the text in. You can’t do anything unless you know that, so why not work in answering it?

Vijaykumar L S
Known Participant
May 23, 2018

Ansi Encoding...

Vijaykumar L S
Known Participant
May 23, 2018

I have used the following code for the Font Encoding

const std::string strFontName = FontName;

pdeFontAttrs.name = ASAtomFromString(strFontName.c_str()); /* font name */

pdeFontAttrs.type = ASAtomFromString("Type1");       /* font type */

pdeFont = PDEFontCreate(&pdeFontAttrs, sizeof(pdeFontAttrs), 0, 255, 0, /* Widths*/ 0, ASAtomNull,/* Encoding*/ 0, 0, 0, 0);/* Font embedding */

PDSysEncoding sysEncoding = PDSysEncodingCreateFromCMapName(ASAtomFromString("Identity-H"));

PDEFontCreateFlags fontCreateFlags = (PDEFontCreateFlags)(kPDEFontCreateToUnicode | kPDEFontCreateEmbedded | kPDEFontWillSubset);

PDSysFont sysFont = PDFindSysFont(&pdeFontAttrs, sizeof(pdeFontAttrs), 0);

pdeFont = PDEFontCreateFromSysFontAndEncoding(sysFont, sysEncoding, pdeFontAttrs.name, fontCreateFlags);

pdeFont = PDEFontCreateFromSysFont(sysFont, kPDEFontCreateEmbedded);

After Doing this...Junk character not Displayed but instead of Original Character it shows Different Formats.

I don't know Where i am Wrong.

Thanks in Advance.

Legend
May 22, 2018

Please answer my question exactly. We cannot tell anything about the encoding from copy/paste text. Please don't tell us that it shows right on screen, that is not the answer without knowing the platform app and system locale. If you don't know the encoding what is the exact hex value of the "mu"?

Legend
May 22, 2018

The encoding will be custom, not one of the few built in names. Do NOT expect to be able to use Unicode ! So, what encoding (character set) are you using for your Greek characters. If you don't know the exact hex values in your string, now is the time to find out.

Vijaykumar L S
Known Participant
May 22, 2018

I want to Display the Character Set "Acuta 12358µ Regulatory Informative System" text into PDF Doc.

But when I stamp the Text into PDF Doc...it Looks like

here...When I debugging, CString Shows Exact String what I Given Input..

but When I add Text into PDEText Object it shows Different Character means "Acuta 12358ae Regulatory System....."

Legend
May 22, 2018

Have you picked a font that contains Greek characters and embedded it?  Going from Latin1 characters ro other encodings is a very big leap in complexity. please look into the fonts — encodings chapter of the PDF specification for concepts needed.

Vijaykumar L S
Known Participant
May 22, 2018

Thank you so much...for your Reply...

I try to Understand Font Encoding....

Legend
May 21, 2018

That suggests that the PDEFont you are using does not match the encoding of the text. What steps have you taken to make sure the font encoding includes Greek?

Vijaykumar L S
Known Participant
May 22, 2018

I have not done any Encoding,,Just create PDEFont and Added text to the PDEText Object and Place it into the PDF Doc...

I dont know how to Encode Diffrent Language Characters....

I have used the following Code to create pdeFont.

pdeFont = PDEFontCreate(&pdeFontAttrs, sizeof(pdeFontAttrs), 0, 255, 0, /* Widths*/ 0, ASAtomNull,/* Encoding*/ 0, 0, 0, 0);/* Font embedding */