These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Delete text greater than specific size (say 40pt)

Nikhil Damle
Registered: Feb 10 2011
Posts: 2

JavaScript or VB code to Delete text greater than specific size (ie.font size).
 
Thanks in Advance

My Product Information:
Acrobat Pro 7.1.4, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is a real tricky one. And it's something you can actually do in a kind of indirect way. But you'll need Acrobat 9 or later. There's no way to do this in Acrobat 7.

Here's the process.

1. Loop through all words on all pages, using "doc.getPageNumWords()" and "doc.getPageNthWordQuad()" to find the bounding box of each word.
2. Unless the word is rotated, the height of the bounding box will be the point size of the text.
3. When a height exceeds your limit, use the quad to place a redaction annot over the word.
4. At the end use the "doc.applyRedactions()" function.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script