• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
XHTML to AttribString conversion has wrong paragraph style
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XHTML to AttribString conversion has wrong paragraph style


  • Subject: XHTML to AttribString conversion has wrong paragraph style
  • From: Glen Simmons <email@hidden>
  • Date: Fri, 7 Apr 2006 15:43:59 -0500

I'm converting some XHTML to an NSAttributedString like so:

webPrefs = [WebPreferences standardPreferences];
[webPrefs setDefaultFontSize:16];
[webPrefs setStandardFontFamily:@"Helvetica"];
optionsDict = [NSDictionary dictionaryWithObjectsAndKeys:NSHTMLTextDocumentType, NSDocumentTypeDocumentAttribute,
webPrefs, NSWebPreferencesDocumentOption, nil];


attrStr = [[NSMutableAttributedString alloc] initWithData: [xmlStr dataUsingEncoding:NSUTF8StringEncoding]
options:optionsDict
documentAttributes:&attributesDict
error:&error];


This works, but the resulting attrib string has an NSParagraphStyle whose ParagraphSpacing is set to the same as the font size, so it ends up looking double-spaced. How do I get it to not do that?

Thanks,
Glen Simmons
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: XHTML to AttribString conversion has wrong paragraph style
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Should I use Sync Services?
  • Next by Date: Re: XHTML to AttribString conversion has wrong paragraph style
  • Previous by thread: Re: precision problem or my error?
  • Next by thread: Re: XHTML to AttribString conversion has wrong paragraph style
  • Index(es):
    • Date
    • Thread