Comments (7)
why close this issue ?This problem occurred in 4.0.8
from vue-pdf.
@rayfoss please give me some feedback about [email protected]
from vue-pdf.
Hello,thanks for your vue-pdf library.
My phone`s resolution ratio is 1920*1080 and my computer is macbook pro. I test my code at them.
it seems that PDF can`t display when you add code as follows:
var devicePixelRatio = window.devicePixelRatio || 1
var pageWidth = viewport.width * devicePixelRatio
var pageHeight = viewport.height * devicePixelRatio
emitEvent('page-size', pageWidth, pageHeight)
canvasElt.width = pageWidth
canvasElt.height = pageHeight
when I use code as follows PDF can display but blurry:
emitEvent('page-size', viewport.width, viewport.height)
canvasElt.width = viewport.width
canvasElt.height = viewport.height
When i use mozilla/pdf.js, the PDF is clear, not as blurry as vue-pdf is.
So maybe your update:3.0.2 had some bugs, please fix it.
Regards
Dcean
from vue-pdf.
I do not have access to a Retina Display to make tests
from vue-pdf.
My related knowledge is finite,i can`t deal with it myself.
Maybe you can try set up window.devicePixelRatio = 2
in your code, then make tests?
Or we need help from others......
from vue-pdf.
doc: https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#JavaScript
from vue-pdf.
@dcean @FranckFreiburger this is an issue relating to differences in vueport sizing vs canvas sizing. You can get the problems to appear even at 125% zoom on desktop. Sidenote, 1.2 worked a lot better with my css hack/page flip throttling.
Problem #1 Page 1 doesn't load (Rendering cancelled exception):
pages don't load reliably, particularly page 1. If page 2 manages to load, it's usually smooth sailing from there.
How to reproduce:
It happens 100% of the time on the android emulator with a nexus 5 Api 26. Setting page zoom on chrome to 500% on a mac makes it happen reliably for me.
RenderingCancelledException {message: "Rendering cancelled, page 1", type: "canvas"}
message:
"Rendering cancelled, page 1"
type:
"canvas"
__proto__:
Error at RenderingCancelledException (webpack-internal:///209:1907:43) at Object.eval (webpack-internal:///209:1911:2) at __w_pdfjs_require__ (webpack-internal:///209:52:30) at Object.defineProperty.value (webpack-internal:///209:12574:18) at __w_pdfjs_require__ (webpack-internal:///209:52:30) at Object._typeof (webpack-internal:///209:7422:26) at __w_pdfjs_require__ (webpack-internal:///209:52:30) at Object.defineProperty.value (webpack-internal:///209:95:18) at eval (webpack-internal:///209:98:10) at webpackUniversalModuleDefinition (webpack-internal:///209:25:20)
name:
"RenderingCancelledException"
stack:
"RenderingCancelledException↵ at RenderingCancelledException (webpack-internal:///209:1907:43)↵ at Object.eval (webpack-internal:///209:1911:2)↵ at __w_pdfjs_require__ (webpack-internal:///209:52:30)↵
Problem #2 subsequent pages don't load (Cannot use the same canvas during multiple render):
Looks like a race condition, a big pdf seems to exacerbate it.
How to reproduce:
I managed to make it show up more reliably on desktop by flipping pages as early as possible. It happens 100% of the time on the android emulator with a nexus 5 Api 26. This reminds me of the problem with flipping pages too quickly.
Error: Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.
at InternalRenderTask_initializeGraphics [as initializeGraphics] (pdf.js?013a:4586)
at eval (pdf.js?013a:3592)
at <anonymous>
Problem #3:
Pages shrink when viewport is zoomed or using HiDPI/Retina
How to reproduce: zoom in on the page and reload in desktop. Happens 100% on N5 emulator, which has a pixel ratio of 3, some devices have 4, some have half ratios such as 1.5.
This is with default styles (width 100%), it normally fills the width if not zoomed in.
from vue-pdf.
Related Issues (20)
- 微前端子应用加载 vue-pdf 时报跨域问题 HOT 2
- PDF切换页面的时候会一闪一闪的,体验很差
- pdf 渲染高度超出屏幕范围,怎么查看屏幕之外的部分
- 项目引入vue-pdf
- pdfRender.cancel().catch(function(err) , undefined (reading 'catch')" HOT 4
- TrueType Collection does not contain "DCWGQU+CambriaMath" font.
- when the window.devicePixelRatio less than 1,the pdf is vague.
- 、
- vue2 + vite require is not defined
- vue2项目编译报错 HOT 2
- 已解决print后字体乱码问题 HOT 1
- 改变视图大小,拖拉窗口会报错
- 使用插件时而出现跨域问题 HOT 1
- 预览带印章的那页,印章展示是不透明的,源文件是透明的,How to fix it!!!!
- pdf花屏:大部分文件正常展示,只有个别文件有问题,如图,有遇到的大佬看到,给个思路。 HOT 2
- 抱歉,未找到浏览器 Sorry, browser not found
- 与@vue/cli-service 5.x 不兼容 HOT 3
- pdf不能预览PDF的电子发票,比如打车发票
- vue-pdf突然不能用了,是跨域了?
- 请问支持VUE3吗 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-pdf.