Как добавить пространство строки в текстовой области pdf в iOS target-c, используя кварц 2D? - PullRequest
0 голосов
/ 28 мая 2018

Я создал страницу PDF с коробкой, используя основную графику ( Изображение ).

Я столкнулся с проблемой, то есть с разделом комментариев. Я не могу установить "Текст" для отдельных лиц.мудрый.Есть идеи, как мне это сделать?

Код для раздела "Комментарий".

textToDraw=@"Comments:";
newfont=fontName2(7);
renderingRect = CGRectMake(20,146.5, 842, 300.0);
[textToDraw drawInRect:renderingRect withFont:newfont lineBreakMode:nil alignment:nil];



////////////////
CGContextSetLineWidth(currentContext, 1.0);
CGContextMoveToPoint(currentContext, 20,155);
CGContextAddLineToPoint(currentContext,295, 155);
CGContextStrokePath(currentContext);

CGContextSetLineWidth(currentContext, 1.0);
CGContextMoveToPoint(currentContext, 20,170);
CGContextAddLineToPoint(currentContext,295, 170);
CGContextStrokePath(currentContext);



CGContextSetLineWidth(currentContext, 1.0);
CGContextMoveToPoint(currentContext, 20,185);
CGContextAddLineToPoint(currentContext,295, 185);
CGContextStrokePath(currentContext);



CGContextSetLineWidth(currentContext, 1.0);
CGContextMoveToPoint(currentContext, 20,200);
CGContextAddLineToPoint(currentContext,295, 200);
CGContextStrokePath(currentContext);


@try{


    textToDraw=@"";
    NSString *commentText=@"helo how are you. i am tuna  string. i have so many friends. helllo i am working.here is my paragraph writing";

    renderingRect = CGRectMake(62, 146, 220, 400);
    newfont=fontName2(7);
    [commentText drawInRect:renderingRect withFont:newfont    lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];



       }

              @catch(NSException *e){

   }
...