Skip to main content
ludvik14ty
Participant
January 5, 2017
Answered

Select area and delete all objects

  • January 5, 2017
  • 2 replies
  • 1939 views

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 has been closed for replies.
Correct answer ludvik14ty

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..." });

2 replies

ludvik14ty
ludvik14tyAuthorCorrect answer
Participant
January 6, 2017

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..." });

try67
Community Expert
Community Expert
January 6, 2017

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

try67
Community Expert
Community Expert
January 5, 2017

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

ludvik14ty
Participant
January 6, 2017

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?