This is a migrated thread and some comments may be shown as answers.

DocumentHandler

1 Answer 61 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Biao
Top achievements
Rank 1
Biao asked on 10 Apr 2015, 03:08 AM

Hey there, 

I am using DocumentHanlder plugin currently in my Android  and iOS app development. 

the handleDocumentWithURL where I used for display PDF document in my App is working on iOS

but in Android App. I donnot know how to resolve this please help. 

 var sourcePath = cordova.file.applicationDirectory + '/www/' + encodeURIComponent(filePath);
            handleDocumentWithURL(function () {
                console.log('Success');
            }, function (error) {
                console.log(error);
            }, sourcePath); 

Cheers 

Jin

1 Answer, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 14 Apr 2015, 03:09 PM
Hi Biao,

Judging by the provided code, you are providing a path to a local file and I don't think this plugin is intended to work this way. It is said in the documentation that you have to pass a URL to the web site where the file is hosted.

If you want to open a local pdf file I would suggest using the InAppBrowser plugin which we have integrated in our Core plugins. We have a sample app that demonstrates this case.

Regards,
Zdravko
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
General Discussion
Asked by
Biao
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
Share this question
or