RE: Unable to generate a PDF from textual data
RE: Unable to generate a PDF from textual data
- Subject: RE: Unable to generate a PDF from textual data
- From: "Lee, Frederick (Ric)" <email@hidden>
- Date: Fri, 14 Nov 2008 15:34:36 -0500
- Thread-topic: Unable to generate a PDF from textual data
Thanks from a neophyte.
Yes...
I had hoped that I could 'magically' create a PDF from a text string.
I noticed that you can select 'text' from a PDF document. I thought you
could likewise create a PDF from text (NSString).
BTW: My client wanted to render text as a PDF on his iPhone.
Ric.
-----Original Message-----
From: David Duncan [mailto:email@hidden]
Sent: Friday, November 14, 2008 1:05 PM
To: Lee, Frederick (Ric)
Cc: email@hidden
Subject: Re: Unable to generate a PDF from textual data
On Nov 14, 2008, at 10:16 AM, Lee, Frederick (Ric) wrote:
> CFDataRef faxMsgData = (CFDataRef)[[self.faxHistoryItemDict
> objectForKey:@"msg"] dataUsingEncoding: NSUTF8StringEncoding];
This is not PDF data, this is just text.
CGPDFDocumentCreateWithProvider() expects valid PDF data to be pulled
from the data provider (and thus from the data object your passing).
If you need to create PDF data, then you will need to use PDFKit or
Core Graphics to create valid PDF data by drawing the text strings
into a pdf context. Then you can get PDF data to do additional work
with (including creating a CGPDFDocument with the PDF data in it).
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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