Product: Python Apryse SDK
Product Version: 10.7.0
I have Redaction Annotations created from client-side WebViewer and stored in XFDF strings. I’m trying to apply those redactions and burn those at server-side using the SDK and there’re two issues I’m encountering.
- for annotations that span accross multiple lines, I need to get its Quads to apply the redaction accurately on those lines but I could only get the rect via
GetRectso I can’t accurately apply those redactions. It’s always just a rectangular box so it will also block text that I didn’t redact.
doc = PDFDoc(pdf_path)
xfdf_string = base64.b64decode(payload).decode("utf-8")
doc.MergeXFDF(xfdf_string)
view = PDFView()
view.SetDoc(doc)
vec = VectorRedaction()
for page in range(view.GetPageCount() + 1):
annots = view.GetAnnotationsOnPage(page)
for ann in annots:
vec.append(Redaction(page, ann.GetRect(), False, "NEED_OVERLAY_TEXT_HERE"))
This is what I have. Essentially, where I call ann.GetRect(), I want to loop through the Quads of the annotation and add Rect for each of those Quads
- I also have
OverlayTextdata in Annotation when it is exported from theWebViewer, but I couldn’t extract it with the SDK. I tried usingGetCustomDataon theAnnotbut it didn’t work.