问题描述
我想知道我在做什么错。 基本上我要打开,然后在Google中查看一些pdf:
<a id="pdflink" href="https://docs.google.com/viewer?url=http://pdpdpd.pdf" target="_blank">Pdf</a>
但是当打开它时,我看到了该视图中的典型工具,例如放大镜,打印件,打开原稿等。 好吧,打印和打开的原件将不起作用,我在计算机上使用chrome时它们没有问题,但是在电话上安装后将不起作用,它的页面将保持空白,什么也不做。
会是什么呢?
1楼
您是否要通过另一个网站链接离线网站?
如果您尝试链接,则使用href而不是id
2楼
不幸的是,您无法下载标记为href的所有文件URL。
- 在这种情况下,您需要使用插件下载文件,
- 使用或查看PDF文件
无论如何,您在答案中提到的URL没有适当的PDF。
3楼
使用文件传输插件下载文件。
https://github.com/apache/cordova-plugin-file-transfer
fileTransfer.download(
uri,
fileURL,
function(entry) {
console.log("download complete: " + entry.toURL());
},
function(error) {
console.log("download error source " + error.source);
console.log("download error target " + error.target);
console.log("upload error code" + error.code);
}
);