【发布时间】:2019-12-25 18:19:39
【问题描述】:
我在 Webview 中显示 PDF 文件,该文件是从服务器获取的 URL。为了显示这一点,我使用了谷歌驱动器查看器,如下所示。
let uri = pdfURL;
if (/\.pdf$/.test(uri)) {
uri = `https://drive.google.com/viewerng/viewer?embedded=true&url=${uri}`;
}
<WebView
source={{ uri }}
style={styles.webView}
onLoad={() => this.hideSpinner()}
startInLoadingState
scalesPageToFit
embedded
onError={(err) => {
}}
/>
但是,它显示的是共享选项,一旦点击它,它显示的是谷歌登录,我想禁用登录选项。
有什么建议吗?
【问题讨论】:
-
你为什么使用谷歌驱动器?
-
@Idan 感谢您的回复,您的意思是,我需要使用库来显示 pdf 吗?
-
你不能使用谷歌驱动器中该文件的可共享链接吗?
-
不,我必须禁用 googlesignin
-
你能分享你的 pdf 网址吗?
标签: react-native pdf ecmascript-6 webview google-signin