Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5948395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:06:05+00:00 2026-05-22T17:06:05+00:00

I m a newbie in iphone. Currently m doing a project to create a

  • 0

I m a newbie in iphone.
Currently m doing a project to create a pdf having tables.
I created that. I can even write the text in table cells.
But now the problem is the data will come dynamically from database. That is also not a big deal if i m using drawinrect function. But now i want to display a rich text i.e. The text can be bold or italic.
How to write such rich text in a bounded rectangle…???

I can have text in html format.
Any solution for this???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:06:06+00:00Added an answer on May 22, 2026 at 5:06 pm
    // Initialize an attributed string. 
    NSString *html = text;
    NSData *data = [html dataUsingEncoding:NSUTF8StringEncoding];
    
    // Create attributed string from HTML
    NSAttributedString *string = [[NSAttributedString alloc] initWithHTML:data baseURL:nil documentAttributes:NULL];
    //  CGColorRef red = CGColorCreate(rgbColorSpace, components); CGColorSpaceRelease(rgbColorSpace); 
    //  CFAttributedStringSetAttribute(attrString, CFRangeMake(0, 50),kCTForegroundColorAttributeName, red);
    // Create the framesetter with the attributed string.
    CTFramesetterRef framesetter =  CTFramesetterCreateWithAttributedString(string);
    // Create the frame and draw it into the graphics context 
    CTFrameRef frame = CTFramesetterCreateFrame(framesetter,CFRangeMake(0, 0), path, NULL);
    CFRelease(framesetter); 
    CTFrameDraw(frame, pdfContext); 
    CFRelease(frame);
    

    This solved my issue 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm a newbie to iphone development. I'm doing a navigation-based app, and I'm having
Cocoa newbie here. I am working on an iPhone UITableViewController-based widget that can be
Please forgive the newbie question. I have an iphone game that currently uses lots
Newbie here...can I write one program which incorporates .NET LINQ and also various Java
Newbie question: I just installed VisualSVN Server and created a repository. I noticed that
I'm a relative newbie on iPhone app development but have successfully created a tab
I am a newbie in iPhone development, doing my first app. I have some
I am a cocoa newbie trying to create an iPhone app including Core Data.
I'm an iPhone/iPod-touch newbie, and would like to write an iPhone application utilizing the
One of my friends(who is a newbie iPhone developer) is having a jailbroken iPhone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.