开发者

DrawText in CGRect for PDF

开发者 https://www.devze.com 2023-04-07 12:38 出处:网络
I\'m trying to create a PDF and I have some text.It is longer than one line, so I\'m not sure how I need to write it int开发者_如何学Pythono my context.Do I calculate a CGRect the size of my text firs

I'm trying to create a PDF and I have some text. It is longer than one line, so I'm not sure how I need to write it int开发者_如何学Pythono my context. Do I calculate a CGRect the size of my text first? From there, how would I do word wrap or things like that in creating a PDF? So far all I've been able to do is to just draw a title at the correct location :-. Thanks.


I recommend using Core Text, as this is a fairly powerful text rendering framework that plays nicely with Quartz. What you're trying to do is easily accomplished using the CTFrame class.

0

精彩评论

暂无评论...
验证码 换一张
取 消