|
| | | | |
Developer’s API - 5 |
|
|
Call the Engine, cont. |
|
|
(BOOL)convertFile(NSString *inputFile) {
NSString *outputFile;
id<PStillVended> theProxy = lookupPStillDOServer();
// if we can't find it, bail:
if (theProxy != nil) {
// if she's not launched, we'll wait until she's licensed or they give up on licensing:
while(![theProxy applicationReadyForInput])
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
outputFile = nextTempUnique([[inputFile lastPathComponent]stringByDeletingPathExtension]);
if ([theProxy convertFile:inputFile toPDFFile:outputFile deleteInput:NO] == 0) {
return YES;
} else NSLog(@"Couldn't convert %@",inputFile);
} else NSLog(@"Couldn't connect to PStill");
return NO;
}
NOTE: Obviously, you must have a licensed version of PStill for this to work! If you just want to test PStill in demo mode, remove the "while (![theProxy applicationReadyForInput]) statement. |
|
|