Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用(.xslx或.pdf)URL在react/javascript中显示(只读)xslx、pdf文件?_Javascript_Reactjs_Iframe_Embed_Docx - Fatal编程技术网

如何使用(.xslx或.pdf)URL在react/javascript中显示(只读)xslx、pdf文件?

如何使用(.xslx或.pdf)URL在react/javascript中显示(只读)xslx、pdf文件?,javascript,reactjs,iframe,embed,docx,Javascript,Reactjs,Iframe,Embed,Docx,我可以使用所有谷歌文档/工作表文件共享url来实现,但是url以.pdf或.xslx结尾的链接,它要么下载,要么无法预览 这是指向实验的codesandbox链接 你可以使用谷歌gview 见下文 https://docs.google.com/gview?url=http://www.africau.edu/images/default/sample.pdf

我可以使用所有谷歌文档/工作表文件共享url来实现,但是url以.pdf或.xslx结尾的链接,它要么下载,要么无法预览

这是指向实验的codesandbox链接


你可以使用谷歌gview

见下文

https://docs.google.com/gview?url=http://www.africau.edu/images/default/sample.pdf