Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.

Using annotations with Cordova plugin

More
9 years 6 months ago #11994 by davosp
I've been trying to use annotations and other features with cordova plugin vuit i get an alert that says: "This document is readonly" when i try to use annotations

This is my controller:
Code:
var app = { initialize: function() { document.addEventListener('deviceready', this.onDeviceReady, false); }, onDeviceReady: function() { var parentElement = document.getElementById('deviceready'); var listeningElement = parentElement.querySelector('.listening'); var receivedElement = parentElement.querySelector('.received'); listeningElement.setAttribute('style', 'display:none;'); receivedElement.setAttribute('style', 'display:block;'); document.getElementById('loadpdf').addEventListener( 'click', function(e) { RadaeePDFPlugin.openFromAssets({ url: 'www/A1. Manual.pdf', password: '' }, function(message) { console.log('Success: ' + message); }, function(err) { console.log('Failure: ' + err); }); } ); if (device.platform === 'Android') { xhr = new XMLHttpRequest(); xhr.open('GET', './A1. Manual.pdf', true); xhr.responseType = 'blob'; xhr.onload = function() { var blob; if (this.status === 200) { blob = new Blob([this.response], { type: 'application/pdf'}); window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function(dir) { dir.getFile('A1. Manual.pdf', { create: true, exclusive: false }, function(file) { file.createWriter(function(fileWriter) { fileWriter.onwriteend = function() { console.log('Successful file write: ' + file.toURL()); }; fileWriter.onerror = function(e) { console.log('Failed file write: ' + e.toString()); }; fileWriter.write(blob); }); }); }); } else { console.log('problem: ' + this.status); } } ; xhr.send(); } else { // iOS RadaeePDFPlugin.activateLicense({ licenseType: 2, company: "Radaee", email: "[email protected]", key: "89WG9I-HCL62K-H3CRUZ-WAJQ9H-FADG6Z-XEBCAO" }, function(message) { console.log('Activated license'); }, function(message) { console.log('License Activation failed'); }); } } }; app.initialize();
More
9 years 6 months ago - 9 years 6 months ago #11999 by nermeen
You are using openFromAssets, and files opened from Assets cannot be modified.

You need to copy your file to the device, and use open instead:
Code:
RadaeePDFPlugin.open( { url: "", //The path of the pdf to open, ex: "file:///mnt/sdcard/Download/Test.pdf" password: "" //password if needed }, function(message) { console.log("Success: " + message); }, function(err){ console.log("Failure: " + err); });
Last edit: 9 years 6 months ago by nermeen.
More
9 years 6 months ago #12010 by davosp
I tried to build for my iPhone but i can't because the bundle id must be com.radaee.pdf.PDFViewer and it doesn't let me build the app for devices, so i just can test the app on iOS simulator. Is there any way to test on my iPhone?
More
9 years 6 months ago #12016 by emanuele
Have you set your team in General tab of Xcode project settings?
Time to create page: 0.404 seconds
Powered by Kunena Forum