Marking and Redacting PDF
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
