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

Marking and Redacting PDF

New Here ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

Hello everyone,

 

I  mark documents for redaction by using the drawing tool to place a rectangle around sensitive data. I then use javascript to place redaction boxes within the rectangles. However, I would like to apply the redactions without deleting the rectangles. Can you help me accomplish this task?

 

Additionally, I prefer to mark documents for redaction using brackets like these "[ ]" , or using a partiallty-completed square/rectangle (only the corners, or the top left and bottom right corner). Is there a drawing tool, or a javascript function that can produce such annotations? I hope to use these annotations instead of the rectangle. 

 

Here is the code I am using to find rectangle annotations and redact:

 

// Get the active document

var doc = event.target;

 

// Get all the rectangle shapes in the document

var rectangles = doc.getAnnots({type: "Rect"});

 

// Loop through each rectangle shape

for (var i = 0; i < rectangles.length; i++) {

    var rectangle = rectangles[i];

 

    // Get the rectangle's coordinates

    var rct = getAnnots(this.pageNum)[i].rect;

    var left = rct[0];

    var right = rct[2];

    var top = rct[3];

    var bot = rct[1];

    qd = [ [left, top, right, top, left, bot, right, bot] ];

    qd.toSource();

 

    // Create a new redaction annotation within the rectangle's bounds

    var redaction = this.addAnnot({

        type: "Redact",

        page: rectangle.page,

        quads: qd,

        repeat:true

    });

}

 

Thank you in advance for your help. Much Appreciated

TOPICS
Edit and convert PDFs , JavaScript

Views

308

Translate

Translate

Report

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 27, 2023 Jan 27, 2023

Copy link to clipboard

Copied

Before redacting, export the comment data to an FDF file, then import it back in afterwards.

Votes

Translate

Translate

Report

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
New Here ,
Jan 27, 2023 Jan 27, 2023

Copy link to clipboard

Copied

This is very helpful, thanks

Votes

Translate

Translate

Report

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 27, 2023 Jan 27, 2023

Copy link to clipboard

Copied

LATEST

Regarding using brackets: There's no built-in way to do that, but it is possible to create a script that will convert the comments you did create (for example, highlights), into this format, using a set of Line comments.

 

If this is something you're interested in, I could develop it for you, for a fee. You can contact me privately by clicking my user-name and then on "Send a Message" to discuss it further.

Votes

Translate

Translate

Report

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