[C++ SDK] Change overlay text color of redaction

Community Beginner ,
May 18, 2020 May 18, 2020

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 )

TOPICS
Acrobat SDK and JavaScript

Views

540

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
May 18, 2020 May 18, 2020

Copy link to clipboard

Copied

I've never used it but it looks as if you just have to set colorval?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 18, 2020 May 18, 2020

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.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 18, 2020 May 18, 2020

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

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 19, 2020 May 19, 2020

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:

  • I can't use the Adobe functions calls that use PDRedactParams as an input as they are expecting the Adobe type struct, not the one I created
  • When I apply the redaction using ...
PDAnnot redaction = PDDocCreateRedaction(current_pdDoc, (PDRedactParams)AugmentedRedactParams) 
  • ... the resulting annotation is shifted down by a ~1/10 of an inch

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
May 19, 2020 May 19, 2020

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. 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines