Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Select area and delete all objects

Community Beginner ,
Jan 05, 2017 Jan 05, 2017

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

TOPICS
Edit and convert PDFs
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Beginner ,
Jan 06, 2017 Jan 06, 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..." });

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2017 Jan 05, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 06, 2017 Jan 06, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 06, 2017 Jan 06, 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..." });

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 06, 2017 Jan 06, 2017
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines