DocumentHandler

2 posts, 0 answers
  1. Biao
    Biao avatar
    4 posts
    Member since:
    Mar 2015

    Posted 09 Apr 2015 Link to this post

    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

  2. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 14 Apr 2015 Link to this post

    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.

     
  3. DevCraft banner
Back to Top