2

I am generating a pdf with certain format in which I placed a rectangular box with the help of the below code...

CGContextRef context = UIGraphicsGetCurrentContext();
CGPathRef path = CGPathCreateWithRect(CGRectMake(40, rectPosition, 540, 150), NULL);
[[UIColor whiteColor] setFill];

//[[UIColor blackColor] setStroke];

CGContextAddPath(context, path);
CGContextDrawPath(context, kCGPathFillStroke);
CGPathRelease(path);

I achieve it but now I want to set the text inside the rectangle and I tried drawRect method and many other... Do help if anyone knows.

1
  • - (void)drawText:(CGFloat)xPosition yPosition:(CGFloat)yPosition canvasWidth:(CGFloat)canvasWidth canvasHeight:(CGFloat)canvasHeight This is the method which is used for writing inside the rectangular frame
    – Aashi
    Feb 17, 2016 at 10:33

1 Answer 1

0
- (void)drawText:(CGFloat)xPosition yPosition:(CGFloat)yPosition canvasWidth:(CGFloat)canvasWidth canvasHeight:(CGFloat)canvasHeight
{
//Here you Can Write whatever you want to add in the rectangle
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.