Skip to main content
Ch__Efstathios
Inspiring
April 15, 2016
Answered

\b when getting text from text items. How to get just the plain text?

  • April 15, 2016
  • 1 reply
  • 675 views

I am using FDK C++ and get TextItems with FTI_String from the active document. But the text from the text items contains some characters that do not appear in the actual text. For example \b. What is this character and how can I get only the plain text without any FrameMaker metadata characters.

This topic has been closed for replies.
Correct answer Russ Ward

Ch,

I think you might be seeing tabs. Submitted as an escape sequence, \b translates to the ASCII backspace character (0x08). For some reason, this is how tabs are represented when you get text from a document with the API. You would expect them to show as \t or ASCII 0x09, but they do not.

There is no way to avoid retrieving a user-entered character when you do F_ApiGetText(). You simply have to do a search and replace once you have the string in your code.

I hope I understand what you are asking here.

Russ

1 reply

Russ WardCorrect answer
Brainiac
April 15, 2016

Ch,

I think you might be seeing tabs. Submitted as an escape sequence, \b translates to the ASCII backspace character (0x08). For some reason, this is how tabs are represented when you get text from a document with the API. You would expect them to show as \t or ASCII 0x09, but they do not.

There is no way to avoid retrieving a user-entered character when you do F_ApiGetText(). You simply have to do a search and replace once you have the string in your code.

I hope I understand what you are asking here.

Russ

Ch__Efstathios
Inspiring
April 15, 2016

Whenever the user presses the tab key a symbol appears in the document and when I retrieve the text I see \b. I will probably replace it with space or handle it in my application when showing the text in the view. Thank you so much.