I am am opening a PDF document using Quartz2D in core graphics, resizing it, and attempting to re-save it to the file system of an iPhone. Problem is I cannot figure out how to write a PDF to the file system. Has anyone had luck with such a problem.
A:
First of all Check this Apple Document
Then suppose upon a button press you want to save your created pdf file
-(IBAction)save:(id)sender{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *dirctryForSaving = [paths objectAtIndex:0];
NSString *saveFileName = @"One.pdf";
NSString *newFilePath = [dirctryForSaving stringByAppendingPathComponent:saveFileName];
const char *filename = [newFilePath UTF8String];
//Calling CreatePDFFile()
CreatePDFFile(Your Pdf file size,filename);
}
CreatePDFFile(Your Pdf file size,filename){
//Create you pdf file
}
raaz
2010-06-24 07:51:33
I should have been more explicit but I basically need to print a PDF file programatically, not just save the file to the device. I have not found a solution yet, but this project is on the back burner so its less of an issue. Thanks for your input though.
LearningiPhoneDevelopment
2010-08-25 22:38:22