Question
Removing formatting from selected text
Hello,
I have written a plugin to select highlighted text from PDF document.
However,text I get from PDF document is retrieved with actual formatting, for example, new line etc.
I want the text without any formatting.
Here is the code snippet to get the highlight annotated text.
Here is my code for getting the annotated text:
- if (ASAtomFromString("Highlight") == PDAnnotGetSubtype(annot))
- {
- // Gets the annotation's rect
- PDAnnotGetRect(annot, &boundingRect);
- // Gets the text selection from the annotation's rect
- PDTextSelect textSelect = PDDocCreateTextSelect(pdDoc, pageNum, &boundingRect);
- // create a callback to get the text from highlighted bounding box
- PDTextSelectEnumText(textSelect, ASCallbackCreateProto(PDTextSelectEnumTextProc, &pdTextSelectEnumTextProc), &annBuf);
- MessageBox(NULL, ss.str().c_str(), NULL, NULL);
- }
String stream contains the string with all formatting.
How can I get the text without any formatting?
Thanks
