Skip to main content
vishals2suryan
Participant
April 27, 2017
Question

I want to apply redaction through coding with overlay red color text

  • April 27, 2017
  • 6 replies
  • 1383 views

            I want to apply redaction through coding with overlay red color text. My code has shown below

           

                        PDRedactParams RParams;

                                    RParams = (struct _t_PDRedactParams *)malloc(sizeof(PDRedactParamsRec));

                                    RParams->size = sizeof(PDRedactParamsRec);

                                    RParams->pageNum = iIndexPage;

                                    RParams->redactQuads = &quad;

                                    RParams->numQuads = 1;

                                    PDColorValueRec Red;

                                    Red.space = PDDeviceRGB;

                                    Red.value[0] = ASInt32ToFixed(1);

                                    Red.value[1] = ASInt32ToFixed(0);

                                    Red.value[2] = 0;

                                    RParams->colorVal = &Red;

                                    const char *docTitleValue = "Title";

                                    ASText text = ASTextNew();

                                    ASTextSetEncoded(text, docTitleValue,

                                                (ASHostEncoding)PDGetHostEncoding());

                                   

                                    RParams->overlayText = text;

                                    RParams->horizAlign = kPDHorizLeft ; 

           

                                    PDAnnot redactAnnot =  PDDocCreateRedaction(pdDoc, RParams);

                                    PDApplyRedactionParams applyparam;

                                    applyparam = (struct _t_PDApplyRedactionParams*)malloc(sizeof(_t_PDApplyRedactionParams));

                                    applyparam->size = sizeof(_t_PDApplyRedactionParams);

                                    applyparam->redactionAnnots= &redactAnnot;

                                    applyparam->redactionCount = 1;

                                    applyparam->keepMarks = true;

                                    applyparam->statusProcs = NULL;

                                    applyparam->progressText = NULL;

                                    applyparam->progressDuration = NULL;

                       

                                    PDDocApplyRedactions(pdDoc, applyparam);

            It is applying redaction without overlay text. Please someone help me to solve the issue.

This topic has been closed for replies.

6 replies

try67
Community Expert
Community Expert
May 24, 2017

If you can create the redaction markups using JavaScript it's very easy to do that... You just use the addAnnot method to create the Redaction annotation, set the overlayText property to the text you want to appear and the textColor property to the color you want it to have. There's an example of this under the documentation of the overlayText property in the Acrobat JS Reference API.

May 26, 2017

Thank you for the response. I added overlay text using PDETextAdd method.

Thanks,

Sowbhagya

Legend
May 10, 2017

It may be worth buying a support case, as I said.

Legend
May 3, 2017

Sorry, outbid my experience now. But you now seem to have valid code. It may be worth buying a support case.

May 10, 2017

Hello,

    I am able to redact selected text using PDDocApplyRedactions and adding PDEPath ( mask). But how to add the text for the mask.

Should I add PDEForm  and text to implement redaction with overlay text. ( how Acrobat does ).

Please help me to solve the issue.

Thanks,

Sowbhagya

lrosenth
Adobe Employee
Adobe Employee
May 13, 2017

It would appear that although the documentation IMPLIES that you can just set a color and/or text and the SDK will do all the work for you – this was never actually implemented. You need to instead create the Form XObject yourself and add that to the redaction params – and it will be placed into the annotation location (or just that yourself after redaction).

Legend
May 3, 2017

please fill in the colour correctly and tell us what you now see on the page at the redaction point when it is applied.

May 3, 2017

Thanks for the reply. After filling the color and apply redaction, it shows PDEPath ( mask) what i have applied. On mouse of that coordinates, it shows overlay text and disappears PDEPath ( mask what i have applied after redaction). But i want that mask along with text how acrobat does redaction using properties.

Thank  you,

Sowbhagya

Legend
May 2, 2017

I don't see how RParams->colorVal = 0 can compile either. colorVal is a structure, not an integer or pointer. Why don't you fill it in as red?

May 3, 2017

Thanks for the reply. ok. I will fill it as red. But what about overlay text. I want PDEPath and text how acrobat shows after redaction. Please help me to solve the issue.

Thanks,

Sowbhagya

Legend
April 27, 2017

If the documentation is correct, I don't see how this line could even compile:

                                    RParams->colorVal = &Red;

May 2, 2017

Thanks for the reply.  I have corrected the code by passing 0 as RParams->colorVal = 0.

I want to implement plugin redaction with overlay text exactly how acrobat does. I have implemented above code for redaction and applying mask by adding PDEPath for the coordinates. It shows exactly how acrobat does redaction.

But I after adding overlay text for the redaction, if we mouse move on redaction, it disappears mask ( PDEPath) and shows overlay text. But I want PDEPath and text how acrobat shows.

Please help me to resolve the issue.

Thanks,

Sowbhagya