Problem with inline system service call.
Problem with inline system service call.
- Subject: Problem with inline system service call.
- From: Rich Van Deren (äèä) <email@hidden>
- Date: Sat, 27 Apr 2002 08:36:48 -0700
My Apache.org Fop service works ok if I use the services menu, however,
my inline call below gets a malloc error:
*** malloc[641]: error: Can't allocate region
Any ideas on what causes this?
- (void)createPDF:(id)sender
{
BOOL result;
NSString *foString = @"";
NSString *serviceItem = @"Create PDF from FO";
NSArray *myTypes = [[NSArray alloc] init];
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
//NSGeneralPboard
NSRange foSourceRange = NSMakeRange(0, [[formattingObjectsTextView
string] length]);
[formattingObjectsTextView setSelectedRange:(NSRange)foSourceRange];
myTypes = [formattingObjectsTextView writablePasteboardTypes];
foString = [formattingObjectsTextView string];
[pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType]
owner:self];
result = [pboard setString:foString forType:NSStringPboardType];
// result = [formattingObjectsTextView
writeSelectionToPasteboard:(NSPasteboard *)pboard type:(NSString
*)NSStringPboardType];
if (result)
{
NSLog(@"write to pasteboard OK");
[resumeMainMessageField setStringValue:@"Creating PDF please
wait."];
[resumeMainMessageField setTextColor:[NSColor greenColor]];
result = NSPerformService( serviceItem, pboard );
if (result) {
[resumeMainMessageField setStringValue:@"PDF Created."];
[resumeMainMessageField setTextColor:[NSColor blueColor]];
}
else
{
[resumeMainMessageField setStringValue:@"Problem with PDF
create."];
[resumeMainMessageField setTextColor:[NSColor redColor]];
}
}
else
NSLog(@"write to pasteboard BAD");
[resumeMainMessageField setStringValue:@"Write to pasteboard
failed."];
[resumeMainMessageField setTextColor:[NSColor redColor]];
}
300 Refugio Rd
Santa Cruz, CA 95060-2348
831-469-4348
Fax: 831-480-5868
Instant Messagers: Yahoo: rhvanderen AOL/Netscape rhvanderen MSN:
email@hidden ICQ: 31286953
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.