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.

Cordova iOS app crash with local PDF

More
9 years 6 months ago #11107 by phillip_plum
Hello,
we are using the cordova Plugin. When I open a remote PDF, everything is fine. But when i try to load a PDF from the filesystem, I get every time this error:

2016-08-31 15:30:50.993 OstfriesischerKurier[509:52877] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(0x21ed9b0b 0x21696dff 0x21dea6d3 0x1273dd 0x11dbf1 0x11defd 0x2653becb 0x2454e325 0x24537b23 0x2462c79d 0x24536fdb 0x2451af0d 0x2451abc5 0x2451a081 0x24519d55 0x264a67f5 0x21e9b2b1 0x21e995a7 0x21e999e5 0x21de81c9 0x21de7fbd 0x23404af9 0x2651c435 0x103a13 0x21a94873)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
More
9 years 6 months ago #11108 by emanuele
Hi,

can you share the slice of code used to open the local file? the method searches into Documents folder, so the file must be located there (or in a subfolder).
More
9 years 6 months ago #11109 by phillip_plum
Hi,
i use this code:
Code:
RadaeePDFPlugin.open({ url: "epapers/"+ePaper.id+".pdf" }, function(message) { console.log("Success: "); console.log(message); }, function(err){ console.log("Failure: "); console.log(err); });

When i use the "wrong" url i get a error but when i use the "right" url the app crashed. With the same PDF, but on a server it works.
More
9 years 6 months ago #11110 by emanuele
If you have to open a file located in documents folder, you have to use "file://" before the file name/file path: url: "file://epapers/"+ePaper.id+".pdf"
if you have to open a file from assets, you can use openFromAssets method, in this case you can use directly the file name.
More
9 years 6 months ago #11124 by phillip_plum
Perfect! Thanks, now it works fine.
Time to create page: 0.407 seconds
Powered by Kunena Forum