Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在h5端如何进行pdf预览? #5173

Closed
mabel-xue opened this issue Dec 24, 2019 · 12 comments
Closed

在h5端如何进行pdf预览? #5173

mabel-xue opened this issue Dec 24, 2019 · 12 comments
Assignees

Comments

@mabel-xue
Copy link

尝试了几个插件没有得到解决

@taro-bot
Copy link

taro-bot bot commented Dec 24, 2019

CC @Littly

@taro-bot
Copy link

taro-bot bot commented Dec 24, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@remember-5
Copy link

大佬最后怎么解决的呀

@JakeWoki
Copy link

h5集成pdfjs可以,小程序要怎么预览?不是打开新页面,不占满全屏

@remember-5
Copy link

@JakeWoki

Taro.downloadFile({
            url: url,
            success: function (res) {
              const filePath = res.tempFilePath;
              Taro.openDocument({
                filePath: filePath,
                success: function (res) {
                  console.log("打开文档成功", filePath);
                },
              });
            },
          });

@JakeWoki
Copy link

JakeWoki commented Oct 20, 2020

@remember-5 这样会打开新界面,最重要的是会占满全屏,达不到要求啊

@JakeWoki
Copy link

重新用taro建一个新项目,集成pdf.js后编译成h5,之前的项目webview套进去。。。

@lcoln
Copy link

lcoln commented Apr 27, 2023

@JakeWoki 请问有解决吗,相当于是写一个h5来展示pdf,再用webview来展示这个h5链接?

@JakeWoki
Copy link

@lcoln 是的

@lcoln
Copy link

lcoln commented Apr 27, 2023

@lcoln 是的

但这样还是会全屏展示,有能在局部元素里展示pdf的办法吗

@JakeWoki
Copy link

@lcoln 全部元素放在h5,h5和小程序可以相互跳转

@lcoln
Copy link

lcoln commented Apr 27, 2023

@lcoln 全部元素放在h5,h5和小程序可以相互跳转

明白了,感谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants