Skip to main content
ludvik14ty
Participant
Jan 5, 2017 4:15 PM UTC
Answered

Select area and delete all objects

Hello,

is possible in Adobe Acrobat Pro XI via javascript select area with coordinates (like with selection tool) and after delete all selected objects (texts, images)?

Thanks

This topic is closed to new replies. Start a new post to keep the conversation going.
ludvik14ty
ludvik14tyCorrect answer
Participant
Jan 6, 2017 11:11 AM UTC

It's working now

for(var pg = 0; pg < this.numPages; pg++){

var rCrop = this.getPageBox("Crop",pg);

     this.addAnnot({

          type:"Redact",

          page:pg,

          quads:[[0, 20, rCrop[2], 20, 0, 0, rCrop[2], 0]],

          overlayText: "",

          alignment: 1,

          repeat:true

      })

;}

this.applyRedactions({bKeepMarks: false, bShowConfirmation: false, cProgText: "Processing..." });

4 replies

ludvik14ty
ludvik14tyAuthorCorrect answer
Participant
Jan 6, 2017 11:11 AM UTC

It's working now

for(var pg = 0; pg < this.numPages; pg++){

var rCrop = this.getPageBox("Crop",pg);

     this.addAnnot({

          type:"Redact",

          page:pg,

          quads:[[0, 20, rCrop[2], 20, 0, 0, rCrop[2], 0]],

          overlayText: "",

          alignment: 1,

          repeat:true

      })

;}

this.applyRedactions({bKeepMarks: false, bShowConfirmation: false, cProgText: "Processing..." });

Translate
try67
Community Expert
Community Expert
Jan 6, 2017 11:25 AM UTC

As you've found out, Redaction annotations are defined using quads, not a rect...

Translate
try67
Community Expert
Community Expert
Jan 5, 2017 4:21 PM UTC

Yes. You can create a Redaction annotation over that area and then apply it.

Translate
ludvik14ty
Participant
Jan 6, 2017 10:51 AM UTC

Thanks, I tried following code

this.addAnnot({page: 0,type: "Redact",rect: [[0, 0, 500, 200]]});

But no matter the coordinates, rectangle is always in bottom left corner. Any ideas?

Translate