Are you certain that faxMsgData is valid PDF data? It sounds like it isn't 
being recognized as a PDF.

Cheers,
Chuck

--- On Fri, 11/14/08, Lee, Frederick (Ric) <[EMAIL PROTECTED]> wrote:

> From: Lee, Frederick (Ric) <[EMAIL PROTECTED]>
> Subject: Unable to generate a PDF from textual data
> To: [email protected]
> Date: Friday, November 14, 2008, 10:16 AM
> Greetings:
> 
>    I'm trying to create a PDF from a NSString; but
> I'm not getting anything.
> 
> What am I doing wrong?
> 
>  
> 
> - (id)initWithData:(NSDictionary *)inData {
> 
>     self = [super init];
> 
>     if (self != nil) {
> 
>         self.faxHistoryItemDict = inData;
> 
>         // 1) Create the PDF Data Source:
> 
>         CFDataRef faxMsgData =
> (CFDataRef)[[self.faxHistoryItemDict
> objectForKey:@"msg"] dataUsingEncoding:
> NSUTF8StringEncoding];
> 
>         CGDataProviderRef faxMsgDataRef =
> CGDataProviderCreateWithCFData(faxMsgData);          
> 
>         // 2) Create the PDF doc:
> 
>         self.faxPDFDoc =
> CGPDFDocumentCreateWithProvider(faxMsgDataRef); // I
> don't get a PDF here. 
> 
>         
> 
>         CGDataProviderRelease(faxMsgDataRef);
> 
>     }    
> 
>     return self;
> 
> } // end initWithData().
> 
>  
> 
> (gdb) po faxPDFDoc
> 
> Cannot access memory at address 0x0  ß ???
> 
>  
> 
> Here's the header:
> 
> @interface PDFDrawing : NSObject<QuartzViewDelegate>
> {
> 
>     CGPDFDocumentRef pdf;
> 
>     NSDictionary    *faxHistoryItemDict;
> 
>     
> 
> @private
> 
>     CGPDFDocumentRef faxPDFDoc;
> 
>     
> 
> }
> 
>  
> 
> @property(nonatomic, retain) NSDictionary   
> *faxHistoryItemDict;
> 
> @property(nonatomic, assign) CGPDFDocumentRef faxPDFDoc;
> 
>  
> 
> - (id)initWithData:(NSDictionary *)inData;
> 
> -(void)drawView:(QuartzView*)view
> inContext:(CGContextRef)context bounds:(CGRect)bounds;
> 
>  
> 
> @end
> 
>  
> 
> Regards,
> 
> Ric.
> 
>  
> 
>  
> 
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/acharlieblue%40yahoo.com
> 
> This email sent to [EMAIL PROTECTED]



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to