Change annot fill colour only if one exists

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Change annot fill colour only if one exists

Post by lidds »

I am changing the annotation colour to grey when being imported using the following code:

Code: Select all

 options("SColor").v = "rgbd(128,128,128)"
                                options("Flags").v = PXC_AnnotFlag.AF_Print + PXC_AnnotFlag.AF_ContentLocked + PXC_AnnotFlag.AF_Locked + PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_SColor
                                options("Mask").v = PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_Flags + PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_SColor
Which works fine. However I also want to change the fill colour of the annotation element to grey, which I know I can do by using the following code:

Code: Select all

 options("SColor").v = "rgbd(128,128,128)"
 options("FColor").v = "rgbd(128,128,128)"
                                options("Flags").v = PXC_AnnotFlag.AF_Print + PXC_AnnotFlag.AF_ContentLocked + PXC_AnnotFlag.AF_Locked + PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_SColor + PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_FColor
                                options("Mask").v = PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_Flags + PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_SColor + PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_FColor
The problem that I have, is if the annotation element did not have a fill colour applied then the above code will now add a fill colour to the annotation element. Therefore how can I just change the fill colour if one exists?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Change annot fill colour only if one exists

Post by Sasha - Tracker Dev Team »

Hello Simon,

When you are modifying the annotations, you are making their list as the input. There you can filter out the unneeded IPXC_Annotations and just don't give them to the modification operation. Or do a separate modification for them.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Change annot fill colour only if one exists

Post by lidds »

Thanks Alex, I get I can build up a separate list of annotations that I want to change the fill colour of and apply the fill options to that list, however is there a command to tell if an annotation item has a full applied to it?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Change annot fill colour only if one exists

Post by Sasha - Tracker Dev Team »

Hello Simon,

You will have to get the https://sdkhelp.pdf-xchange.com/vi ... ext_FColor and see the Type if the IColor:
https://sdkhelp.pdf-xchange.com/view/PXV:ColorType

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply