Donnez vie à vos documents numériques !
 

Répondre à : Extract Highlighted Text in a pdf file and export those text to a other pdf file

abracadabraPDF Forums PDF – Général Extract Highlighted Text in a pdf file and export those text to a other pdf file Répondre à : Extract Highlighted Text in a pdf file and export those text to a other pdf file

#69595
bebarth
Maître des clés

Hi,
Here is the adaptation I did (modifications are indicated after the lines // bebarth). I tried to create a new page and save the file but couldn’t! I think it’s a problem of trustedFunction.
If you find how to do that, let me know… Merlin, an idea?
Change the extension of the attached file from .txt to .js then place the file in the JavaScript folder of your Acrobat Pro.
The script will indicate the words highlighted, but don’t forget the note indicated in the original script:

Code:
* Text returned may not always match exactly the text covered by the highlight.
* This is mainly dependent upon two things: 1) whether a word is adjacent to
* punctuation or not, and 2) whether whole words or partial wordsare highlighted
* or not.

…and then, you can execute from the console:

Code:
this.deletePages({nStart: 1, nEnd: this.numPages-1});
this.saveAs(this.documentFileName.replace(/.pdf/i,  » (Highlighted Texts in a Field).pdf »));

@+
:bonjour: