[TIMOB-14561] iOS : Getting Error in logs while loading a pdf in webView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-10-18T21:11:23.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | ios, pdf, webview |
Reporter | Meenakshi Pathak |
Assignee | Ingo Muschenetz |
Created | 2013-07-16T07:15:18.000+0000 |
Updated | 2014-06-19T12:43:03.000+0000 |
Description
When we try to load a pdf in a webView, we always get an error log :
[ERROR] Couldn't determine the proper encoding. Make sure this file: Test-1.pdf is UTF-8 encoded.
Steps to Reproduce:
1. Create a new project in Titanium.
2. Please find attached pdf.Replace the app.js code with the following code:
Titanium.UI.setBackgroundColor('#000');
var Window = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var webview = Titanium.UI.createWebView({top:0,left:0,height:'100%',width:'100%',url:'Test-1.pdf'});
Window.add(webview);
Window.open();
3. Run the project for iOS device.
4. Go to the project's build folder and launch .xcodeproj file.
5. Run the project and see the logs.
Note : We just get the error logs otherwise the pdf loads in a webview perfectly fine.Tested with setting data
property also but got the same result.
Attachments
File | Date | Size |
---|---|---|
Test-1.pdf | 2013-07-16T07:15:18.000+0000 | 13873 |
Okay, this is due to TiUIWebView.m:533. Namely, we check any local file to see if they're HTML that needs injection. It fails gracefully, which is why the PDF loaded, but we should have a blacklist of file types to not inject.
Closing ticket as duplicate of TIMOB-11665.