开发者

Display PDF in Android - loaded from external, authenticated URL

In my Android app, I need to display a PDF file. The PDF file is read directly from the web, through an API that uses basic authorization (I'm using the Apache HttpClient with a line like request.addHeader("Authorization", "Basic " + Base64.encodeBytes(username + ":" + password).getBytes());)

I've looked through some related questions and the answers seem to either suggest:

  • saving the PDF as a file on the SD card then displaying with some other library, like Apache PDFBox (certainly possible, but adds a 9.8MB library to the app and the hassle of file IO).

  • displaying the PDF through a WebView by passing the URL through the docs.google开发者_StackOverflow.com reader (can't use this approach due to authentication constraint).

I'd be really keen to hear of any possible solutions on this one, thanks!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜