Redaction failed for a random pdf file

Hi,
I am trying to redact a pdf file which is giving redaction status as failed for regex redaction. Attached file and regex pattern below.
Regex: (\\d{14,16})|(\\d{4}[ ]?\\n?\\d{4}[ ]?\\n?\\d{4}[ ]?\\n?\\d{4})|(\\d{4}[-]?\\n?\\d{4}[-]?\\n?\\d{4}[-]?\\n?\\d{4})

System details
Groupdocs redaction : 21.12
Java : 8
Error: Redaction status is failed and redaction log has NullPointerException.

Unit Test

@Test
 void redactPdf() {
    try {
        License l = new License();
            l.setLicense(getClass().getResourceAsStream("/groupdocs.lic"));
        Redactor redactor = new Redactor(getClass().getResourceAsStream(
            "/GitHub - drmonkeyninja_test-payment-cards_ Cheatsheet of test payment cards for various payment gateways-2.pdf"));
        RegexRedaction r = new RegexRedaction("(\\d{14,16})|(\\d{4}[ ]?\\n?\\d{4}[ ]?\\n?\\d{4}[ ]?\\n?\\d{4})|(\\d{4}[-]?\\n?\\d{4}[-]?\\n?\\d{4}[-]?\\n?\\d{4})", new ReplacementOptions("[secret]"));
        RedactorChangeLog redactLog = redactor.apply(r);
        assertEquals(RedactionStatus.Failed, redactLog.getStatus());
        System.out.println(redactLog.getStatus());
        System.out.println(redactLog.getRedactionLog().stream().map(rl -> rl.getResult().getErrorMessage())
            .collect(joining("\n")));
        RasterizationOptions ro = new RasterizationOptions();
        ro.setEnabled(false);
        redactor.save(new ByteArrayOutputStream(), ro);
    } catch (Exception e) {
        fail(e);
    }
}

GitHub - drmonkeyninja_test-payment-cards_ Cheatsheet of test payment cards for various payment gateways-2.pdf (1.0 MB)

1 Like

@shiva.k

Please share following details and we’ll look into this issue:

  • API version that you are evaluating
  • Sample redaction code
  • Exception/error details

Hi,
Thanks for the quick response, I have updated my question with the details asked.

@shiva.k
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): REDACTIONJAVA-173

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as REDACTIONJAVA-173) have been fixed in this update. This message was posted using Bugs notification tool by atir.tahir