Unable to generate a PDF from textual data
Unable to generate a PDF from textual data
- Subject: Unable to generate a PDF from textual data
- From: "Lee, Frederick (Ric)" <email@hidden>
- Date: Fri, 14 Nov 2008 13:16:42 -0500
- Thread-topic: Unable to generate a PDF from textual data
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@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