Copy link to clipboard
Copied
I am writing a plugin that makes uses of the redaction capability in Acrobat.
I am able to create the redaction, and apply the redaction.
Currently, I can change the overlay text, and the color shown once the redaction is applied.
Is there a way to change the color of the overlay text in the C++ SDK?
Notes:
- I am using the PDRedactParams struct to specify the annotation properties (Acrobat _t_PDRedactParams struct documentation )
Copy link to clipboard
Copied
I've never used it but it looks as if you just have to set colorval?
Copy link to clipboard
Copied
I tried changing colorval, and that value sets the color shown once area is redacted. The overlay text stays black by default.
Copy link to clipboard
Copied
Hi,
Can you try to set the value of textColor using setProps, give this a try and see if it works for you.
Thanks,
Charu Karwa
Copy link to clipboard
Copied
The function PDRedactionSetProps() takes an annotation and a PDRedactParams struct as an input. The PDRedactParams struct has no textColor field.
The available fields are
struct _t_PDRedactParams {
ASUns32 size;
ASInt32 pageNum;
ASFixedQuad redactQuads;
ASUns32 numQuads;
PDColorValueRec colorVal;
ASText overlayText;
PDHorizAlign horizAlign;
}
Given that the SDK's PDRedactParams has no textColor field, how would I used it?
I am not sure how to use PDRedactionSetProps given the input parameters required.
I tried to cast a textColor to a PDRedactParams,
ASBool TextColorSuccess = PDRedactionSetProps(redaction, PDRedactParams(textColor))
but the IDE is flagging is as an error. I'm kinda flying blind on this one
========================================
I also tried to create an augmented version of the PDRedactParams by using a namespace to scope it
namespace AugmentedParam{
typedef struct _t_PDRedactParams
{
ASUns32 size;
ASInt32 pageNum;
ASFixedQuad* redactQuads;
ASUns32 numQuads;
PDColorValueRec* colorVal;
ASText overlayText;
PDHorizAlign horizAlign;
PDColorValueRec* textColor;
} PDRedactParamsRec, *PDRedactParams;
}
When creating the new redaction parameters I used the scoped version, not the SDK's
AugmentedParam::PDRedactParams AugmentedRedactParams;
The results:
PDAnnot redaction = PDDocCreateRedaction(current_pdDoc, (PDRedactParams)AugmentedRedactParams)
Copy link to clipboard
Copied
This convenience function doesn’t set all possible redaction options. These are described in 32000-1 (PDF reference) or you can examine an existing annot. Since you have a PDAnnot you can set more options as for any annot subclass. I guess.