Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11665] iOS: Loading local pdf in a webview throws encoding error in the console

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-08-12T22:36:37.000+0000
Affected Version/sRelease 2.1.3, Release 3.1.0
Fix Version/s2013 Sprint 16, 2013 Sprint 16 Core, Release 3.2.0
ComponentsiOS
Labelsn/a
ReporterAnirudh Nagesh
AssigneeBlain Hamon
Created2012-11-05T17:39:17.000+0000
Updated2013-10-18T21:10:21.000+0000

Description

Run the below code snippet with a sample pdf file in resources folder. Error is seen in the console, however pdf is displayed properly in the webview.
var mWin=Ti.UI.createWindow();

var mWebView=Ti.UI.createWebView({
});

mWebView.url='1.pdf';
mWin.add(mWebView);

mWin.open();

Comments

  1. jithinpv 2013-05-06

    issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
  2. Blain Hamon 2013-07-30

    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.
  3. Blain Hamon 2013-07-31

    Pull #4517 pending
  4. Wilson Luu 2013-10-18

    Closing ticket as fixed. Verified local pdf gets loaded in webview and no encoding errors appear in the console. Tested on: Titanium Studio, build: 3.2.0.201310180511 OS: Mac OS X Mountain Lion (10.8.5) SDK build: 3.2.0.v20131018121230 Devices: iphone 4 (5.1.1), iphone 5 (7.0.2)

JSON Source