{ "id": "169610", "key": "TIMOB-25185", "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": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2017-08-27T13:40:37.000+0000", "created": "2017-08-21T20:13:14.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-08-06T17:52:07.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": [], "description": "When attempted to render a PDF in a webview, if using the data property for the webview, the PDF will not display on Android. It will work on iOS>", "attachment": [ { "id": "63116", "filename": "webview-pdf.zip", "author": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-21T20:13:06.000+0000", "size": 7084187, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: WebView using data will not load PDF", "creator": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "\r\nNode.js\r\n Node.js Version = 6.11.2\r\n npm Version = 3.10.10\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 6.1.2.GA", "closedSprints": [ { "id": 939, "state": "closed", "name": "2017 Sprint 17 SDK", "startDate": "2017-08-13T23:08:29.095Z", "endDate": "2017-08-27T23:08:00.000Z", "completeDate": "2017-08-27T21:10:54.125Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "426991", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~jceaser],\r\n\r\nAndroid only supports loading data from a Blob, not a File. Please take a look this doc link\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.WebView-property-data\r\n\r\nSo you can check out the following links for the solution\r\n- https://archive.appcelerator.com/question/179830/open-a-pdf-file-from-remote-server-in-android#comment-223021\r\n- https://gist.github.com/MotiurRahman/26bf43bb239533aa73e1\r\n\r\nThanks", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-08-22T01:12:53.000+0000", "updated": "2017-08-22T01:12:53.000+0000" }, { "id": "426997", "author": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Motiur Rahman, which is precisely why I'm passing file.read(). This should return a Blob http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Filesystem.File-method-read. I believe there is still something wrong and I have tried your 2nd snippet and it does not work on android.", "updateAuthor": { "name": "jceaser", "key": "jceaser", "displayName": "Joshua A. Ceaser", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-22T02:56:52.000+0000", "updated": "2017-08-22T03:03:16.000+0000" }, { "id": "427004", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~jceaser],\r\n\r\nCurrently, Android does not work like iOS in this respect. The WebView widget cannot display PDF documents on Android.\r\n\r\nYou will have to:\r\n\r\n- Use a third party module for that\r\n- Open a pdf viewer app via an Intent\r\n- Use Google docs in a webview\r\n\r\nHowever, I am forwarding this to our engineering team if it is possible loading data from a Blob. \r\n\r\nThanks", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-08-22T06:33:30.000+0000", "updated": "2017-08-22T07:13:46.000+0000" }, { "id": "427288", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Native Android does not support opening local web-views, this is a platform limitation. Native discussions (like [here|https://stackoverflow.com/a/9434924/5537752]) suggest Google Drive open to it or open it as an Intent (supported by Titanium as well, more native experience). Other options are JS-libraries like pdf.js, but the web-view itself will not be able to handle PDF's until Android itself can.\r\n\r\nHere are some more links you can reference to:\r\n- https://stackoverflow.com/a/25481327/5537752\r\n- https://stackoverflow.com/a/21493956/5537752", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-27T13:40:22.000+0000", "updated": "2017-08-27T13:40:22.000+0000" }, { "id": "440283", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as \"not our bug\". If you disagree, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:52:07.000+0000", "updated": "2018-08-06T17:52:07.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }