I downloaded iOS SDK from your website. I tried to convert document to pdf file. I used [Convert ToPdf: in_filename:] function in my application.
I wrote a several lines of code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
PDFDoc *pdfdoc = [[PDFDoc alloc] init];
NSString *inputFile = [[NSBundle mainBundle] pathForResource:@“sample” ofType:@“doc”];
NSString *outputFile = [documentsPath stringByAppendingPathComponent:@“sample.pdf”];
[Convert ToPdf: pdfdoc in_filename: inputFile];
[pdfdoc SaveToFile: outputFile flags: e_linearized];
NSLog(@“Converted file: %@\n to: %@\n”, inputFile, outputFile);
And app crashes with error:
2013-04-08 11:08:15.068 PDFViewCtrl[565:907] *** Terminating app due to uncaught exception ‘PDFNet Exception’, reason: ‘An error occurred while converting the file.
ToPDF cannot convert this file on a non-Windows platform.’
What do I do wrong?
Conversion to PDF directly from MS Office or via a virtual printer driver does not work on iOS because the operating system does not support these features. If you wish to convert MS Word documents to PDF, I would suggest creating a system where your mobile app communicates with a Windows server-based instance of PDFNet which is capable of doing the conversion.
Trial versions of our Windows SDK can be downloaded here:
As you can see we support .NET flavours from 1.1 through 4, as well as C, C++, JAVA, Ruby and Python. For the best results for conversion from PDF to Office, you should have MS Office installed as PDFNet uses Office interop functionality to produce high quality PDFs. If you do not have MS Office, then installing any other program that can print Word documents will also work (e.g. Wordpad that comes as part of Vista+ will do the job). The hardware requirements will depend on the type and quantity of documents you are converting.
An alternative to an on-premises deployment is to use our Cloud API, which support conversion from Office to PDF. You can read more about it and sign up for a trial account online here: http://www.pdftron.com/pdfnet/cloud/index.html