Junk Character Display for Some Greek Characters in Acrobat DC

Community Beginner ,
May 20, 2018

Copy link to clipboard

Copied

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]

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

TOPICS
Acrobat SDK and JavaScript

Views

1.2K

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

Junk Character Display for Some Greek Characters in Acrobat DC

Community Beginner ,
May 20, 2018

Copy link to clipboard

Copied

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]

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

TOPICS
Acrobat SDK and JavaScript

Views

1.2K

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
May 20, 2018 0
Most Valuable Participant ,
May 21, 2018

Copy link to clipboard

Copied

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?

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...
May 21, 2018 0
Community Beginner ,
May 21, 2018

Copy link to clipboard

Copied

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 */

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...
May 21, 2018 0
Most Valuable Participant ,
May 22, 2018

Copy link to clipboard

Copied

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.

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...
May 22, 2018 1
Community Beginner ,
May 22, 2018

Copy link to clipboard

Copied

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

I try to Understand Font Encoding....

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...
May 22, 2018 0
Community Beginner ,
May 22, 2018

Copy link to clipboard

Copied

I have tried to Encode PDEFont using the following code...

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

PDSysEncoding sysEncoding = PDSysEncodingCreateFromCMapName(ASAtomFromString("UniJIS-UTF16-H"));  //encoding  used is "UniJIS-UTF16-H"

pdeFont = PDEFontCreateFromSysFontAndEncoding(sysFont, sysEncoding, pdeFontAttrs.name, kPDEFontCreateEmbedded | kPDEFontCreateSubset | kPDEFontEncodeByGID | kPDEFontDeferWidths | kPDEFontCreateToUnicode);

pdeFont = PDEFontCreateFromSysFont(sysFont, kPDEFontCreateEmbedded);

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

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...
May 22, 2018 0
Adobe Employee ,
May 22, 2018

Copy link to clipboard

Copied

Why would you choose a Japanese encoding (UniJIS)? And even if that was the one you wanted, you don’t bother passing it to PDEFontCreate()…

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...
May 22, 2018 0
Community Beginner ,
May 22, 2018

Copy link to clipboard

Copied

Please Suggest me...How i need to go for Encode Greek Characters...and Displayed those in the PDF Doc...

Thanks

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...
May 22, 2018 0
Adobe Employee ,
May 22, 2018

Copy link to clipboard

Copied

There is a sample in the SDK that shows how to draw Unicode text in a PDF. Have you looked at that sample?

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...
May 22, 2018 0
Community Beginner ,
May 22, 2018

Copy link to clipboard

Copied

I was new in C++....

No...I am Looking for SDK Samples..

Please Send me Some code about how to add encoded text into pdf Doc...This was more helpful to me..

Thank You..

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...
May 22, 2018 0
Most Valuable Participant ,
May 22, 2018

Copy link to clipboard

Copied

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.

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...
May 22, 2018 0
Community Beginner ,
May 22, 2018

Copy link to clipboard

Copied

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

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...
May 22, 2018 0
Most Valuable Participant ,
May 22, 2018

Copy link to clipboard

Copied

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"?

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...
May 22, 2018 0
Community Beginner ,
May 23, 2018

Copy link to clipboard

Copied

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.

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...
May 23, 2018 0