• 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
NSAttributedString and PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAttributedString and PDF


  • Subject: NSAttributedString and PDF
  • From: Julio Cesar Silva dos Santos <email@hidden>
  • Date: Sat, 27 Jan 2007 10:26:48 -0200

Hello,

I would like to know if there is a way of saving an NSAttributedString into PDF format. This NSAttributedString comes from an NSTextView and I know that Views have the dataWithPDFInsideRect: method but when I save it to a PDF file it becomes weird (no margins, for example).
My code so far:


PDFDocument * myPDF = [[PDFDocument alloc] initWithData:[myTextView dataWithPDFInsideRect:[myTextView bounds]]];
[myPDF writeToFile:[@"~/Documents" stringByExpandingTildeInPath]];


If I get the data of the NSAttributedString (using dataFromRange:) the PDF document is not created because it lacks the '%PDF' tag.

Am I getting the right approach? Any suggestion will be welcomed.

Thanks,


Julio Cesar Silva dos Santos email@hidden email@hidden Blogjective-C http://www.jcs.santos.nom.br/wp FetchYourLyrics http://www.jcs.santos.nom.br/fyl/fyl.html


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSAttributedString and PDF
      • From: John Calhoun <email@hidden>
    • Re: NSAttributedString and PDF
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Mount/Unmount events in Foundation tool
  • Next by Date: Strange results when converting NSDate timeIntervalSinceReferenceDate to NSPoint
  • Previous by thread: Re: transparent background in Quartz Composition
  • Next by thread: Re: NSAttributedString and PDF
  • Index(es):
    • Date
    • Thread