{ "id": "117216", "key": "TIMOB-14561", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2013-10-18T21:11:23.000+0000", "created": "2013-07-16T07:15:18.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios", "pdf", "webview" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "30238", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "104379", "key": "TIMOB-11665", "fields": { "summary": "iOS: Loading local pdf in a webview throws encoding error in the console", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:43:03.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When we try to load a pdf in a webView, we always get an error log :\r\n{code}\r\n[ERROR] Couldn't determine the proper encoding. Make sure this file: Test-1.pdf is UTF-8 encoded.\r\n{code}\r\n\r\nSteps to Reproduce:\r\n1. Create a new project in Titanium.\r\n\r\n2. Please find attached pdf.Replace the app.js code with the following code:\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\nvar Window = Titanium.UI.createWindow({ \r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar webview = Titanium.UI.createWebView({top:0,left:0,height:'100%',width:'100%',url:'Test-1.pdf'});\r\n\r\nWindow.add(webview);\r\n\r\nWindow.open();\r\n{code}\r\n\r\n3. Run the project for iOS device.\r\n\r\n4. Go to the project's build folder and launch .xcodeproj file.\r\n\r\n5. Run the project and see the logs.\r\n\r\n\r\nNote : 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.", "attachment": [ { "id": "40781", "filename": "Test-1.pdf", "author": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-16T07:15:18.000+0000", "size": 13873, "mimeType": "application/pdf" } ], "flagged": false, "summary": "iOS : Getting Error in logs while loading a pdf in webView", "creator": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 5.1,iOS 6.1.4, TiSDk 3.1.0 ", "comment": { "comments": [ { "id": "263841", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "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.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-30T00:46:25.000+0000", "updated": "2013-07-30T00:46:25.000+0000" }, { "id": "275735", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate of TIMOB-11665.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-10-18T21:11:03.000+0000", "updated": "2013-10-18T21:11:03.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }