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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to