• 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: "Michael Ash" <email@hidden>
  • Date: Fri, 14 Nov 2008 14:17:04 -0500

On Fri, Nov 14, 2008 at 1:16 PM, Lee, Frederick (Ric)
<email@hidden> wrote:
> Greetings:
>
>   I'm trying to create a PDF from a NSString; but I'm not getting anything.
>
> What am I doing wrong?

Are you thinking that your code will build a PDF which contains a
visual representation of the text contained in the NSString? If so,
this isn't right, it's barely even wrong.
CGPDFDocumentCreateWithProvider expects raw PDF data. In other words,
it expects you to already have a PDF from somewhere, and all it does
is read that PDF into memory so you can work with it. It's not going
to magically realize that you're giving it human-readable text,
perform rendering and layout on that text, and produce a PDF document
from it.

If your goal is to create a new PDF which visually contains a string,
your best approach is probably to put that string into an NSTextView,
and then use the Cocoa printing system to generate a PDF from it.

Mike
_______________________________________________

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

References: 
 >Unable to generate a PDF from textual data (From: "Lee, Frederick (Ric)" <email@hidden>)

  • Prev by Date: Re: Unable to generate a PDF from textual data
  • Next by Date: Re: Determining GUI ivar assignments in IB
  • Previous by thread: Re: Unable to generate a PDF from textual data
  • Next by thread: Re: Determining GUI ivar assignments in IB
  • Index(es):
    • Date
    • Thread