ILPDFKit icon indicating copy to clipboard operation
ILPDFKit copied to clipboard

Can't add ILPDFKit to custom view

Open mob-rockstar opened this issue 7 years ago • 5 comments

Dear I am trying to display the PDF to custom view using ILPDFKit , not full screen view controller. Let me know how can I use the ILPDFKit to display the PDF into custom view

mob-rockstar avatar Jul 14 '17 06:07 mob-rockstar

@mob-rockstar did you find the answer to your question? can you share if yes

codicil avatar Jul 20 '17 18:07 codicil

I have tried It with success! you can add ILPDFViewController's view as subView. and is working fine.For example ,

NSString *filePath = @"filepath for your PDF"
ILPDFViewController  *pdfController = [[ILPDFViewController alloc]init];
ILPDFDocument *pdfDocument = [[ILPDFDocument alloc]initWithPath:filePath];            
[pdfController setDocument: pdfDocument];
[pdfController setDelegate:self];            
[pdfController setFrame:self.view.frame];
[self.view addSubview: pdfController.view];

Hope this will help you!

SaurabhPrajapati avatar Jul 21 '17 09:07 SaurabhPrajapati

Thanks for your reply. I want to ask you one more thing. Can I use the server url as a filePath of PDF ?

This library can only load pdf from local? I will wait your reply. Regards

On Jul 21, 2017, at 11:04 AM, Saurabh Prajapati [email protected] wrote:

I have tried It with success! you can add ILPDFViewController's view as subView. and is working fine.For example ,

        NSString *filePath = @"filepath for your PDF"
        ILPDFViewController  *pdfController = [[ILPDFViewController alloc]init];
        ILPDFDocument *pdfDocument = [[ILPDFDocument alloc]initWithPath:filePath];
        
        [pdfController setDocument:pdfCoachingDocument];
        [pdfController setDelegate:self];
        
        [pdfController setFrame:self.view.frame];
        [self.view addSubview: pdfController.view];

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/derekblair/ILPDFKit/issues/59#issuecomment-316947592, or mute the thread https://github.com/notifications/unsubscribe-auth/AQGxLvd_XUCvS-cLasr6Ir-wPoaglMbkks5sQGmVgaJpZM4OX4El.

mob-rockstar avatar Jul 21 '17 09:07 mob-rockstar

first you can download the file from URL , so you get NSData object , then you can use "initWithData" method of ILPDFDocument

SaurabhPrajapati avatar Jul 21 '17 09:07 SaurabhPrajapati

I have to display the PDF from server url, not local. If you have any solutions, let me know

On Jul 21, 2017, at 11:37 AM, Saurabh Prajapati [email protected] wrote:

first you can download the file from URL , so you get NSData object , then you can use "initWithData" method of ILPDFDocument

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/derekblair/ILPDFKit/issues/59#issuecomment-316955374, or mute the thread https://github.com/notifications/unsubscribe-auth/AQGxLoP1-nyBXHFNiCPz0Ay-0gXkc46uks5sQHF2gaJpZM4OX4El.

mob-rockstar avatar Jul 21 '17 09:07 mob-rockstar