• 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
RE: Unable to generate a PDF from textual data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Unable to generate a PDF from textual data
      • From: "Michael Ash" <email@hidden>
References: 
 >Unable to generate a PDF from textual data (From: "Lee, Frederick (Ric)" <email@hidden>)
 >Re: Unable to generate a PDF from textual data (From: David Duncan <email@hidden>)

  • Prev by Date: Re: Notifying that a TextView's content has been changed?
  • Next by Date: Re: Notifying that a TextView's content has been changed?
  • Previous by thread: Re: Unable to generate a PDF from textual data
  • Next by thread: Re: Unable to generate a PDF from textual data
  • Index(es):
    • Date
    • Thread