How to change colorStroke for Digital Signature

Hi,

I’m creating a digital signature and I want to change the color of my signature on the pdf, How do I do that in iOS (Objective C)?

I managed to change the thicknessStroke of the signature on the pdf from Thin to Normal to Thick.

I tried the below code to change the color of my signature on the pdf but couldn’t succeed.

# “DigitalSignatureTool.h” Class

-(void)saveAppearanceWithPath:(NSMutableArray*)points fromCanvasSize:(CGSize)canvasSize
{
PTElement *element = [apBuilder PathEnd];
[element SetPathStroke:YES];

[[element GetGState] SetLineWidth:1.0f];
[[element GetGState] SetLineCap:e_ptround_cap];
[[element GetGState] SetLineJoin:e_ptround_join];

//This is where I tried to change the color
[[element GetGState] SetStrokeColorWithColorPt:[[PTColorPt alloc] initWithX:1.0f
y:0.0f
z:0.0f
w:1.0f]];

}

Try calling SetStrokeColorSpace before SetStrokeColorWithPT

For example
[[element GetGState] SetStrokeColorSpace: [PTColorSpace CreateDeviceRGB]]; [[element GetGState] SetStrokeColorWithColorPt:[[PTColorPt alloc] initWithX:1.0f y:0.0f z:0.0f w:1.0f]];

This worked like a charm. Thank you.