I am working on display PDF from resourse folder
on UIScrollview
. But it is not able to add.
I add UIScrollView
on ViewController
. Then take a UIImageView
and add on UIScrollView
as bellow code.
scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0.0, 0.0,768,1024)];
scrollView.contentSize = CGSizeMake(768,2000);
scrollView.delegate = self;
scrollView.pagingEnabled = NO;
[self.view addSubview:scrollView];
UIImageView *img=[[UIImageView alloc] initWithFrame:CGRectMake(00, 20, 500,900)];
NSString *url = [[NSBundle mainBundle]pathForResource:@"Acknowledgements" ofType:@"pdf"];
img.image=[UIImage imageWithContentsOfFile:url];
[scrollView addSubview:img];
But pdf is not added on scrollview. If i add some image file like
NSString *url = [[NSBundle mainBundle]pathForResource:@"trophy" ofType:@"png"];
It get added. PDF file is correct and open in Mac. Same case happen with PPT file.
what is going wrong. Thanks