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

Can I remove all elements in a certain rectangle area using js?

gavin2u
Registered: Jul 3 2009
Posts: 76

I have a plenty of pdf docs, which have an image or something else in a certain rectangle area, each page the same.

Can I remove them using js in acrobat?

That is, if I can obtain the coordination of the rectangle (not precisely), can I empty the rectangle?

---

BTW, in the content panel of acrobat, it appears as 'XOject: Image w:125 h:113'

V/R,

gavin

My Product Information:
Acrobat Pro Extended 9.3.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You can create a redaction annotaion over that area and then apply it.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gavin2u
Registered: Jul 3 2009
Posts: 76
try67 wrote:
You can create a redaction annotaion over that area and then apply it.
Over that area? However, that would not remove those object actually...
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Why not?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gavin2u
Registered: Jul 3 2009
Posts: 76
try67 wrote:
Why not?
You mean annotation? Right?

Isn't it created to illustrate something? Okay, I'll try it out.

Thanks :)
gavin2u
Registered: Jul 3 2009
Posts: 76
try67 wrote:
Why not?
var annot = this.addAnnot({page: 0,type: "Square",anthor: "",name: "hideme",rect: [400, 400, 550, 550],fillColor: color.red,width: 0});

Now, I can cover that XObject with a square annotation. But I still appreciate any idea to remove them actually. 'Cause those image objects still alive, you can discover them using acrobat or foxit reader tools...

V/R,

gavin
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Use an annotation of type "Redact". Then you can use the document's applyRedactions method to apply it.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gavin2u
Registered: Jul 3 2009
Posts: 76
try67 wrote:
Use an annotation of type "Redact". Then you can use the document's applyRedactions method to apply it.
Thanks a lot. ^^

I'll give it a go.