NSAttributedString and PDF
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