FranckFreiburger / vue-pdf

vue.js pdf viewer
MIT License
2.23k stars 522 forks source link

Display multiple pages - Unhandled Promise Rejection: RenderingCancelledException: Rendering cancelled, page 1 #202

Open hormiklos opened 4 years ago

hormiklos commented 4 years ago

Hi,

I am using the 'Example - display multiple pages of the same pdf document', and during rendering got this console errors (for all pages): "Unhandled Promise Rejection: RenderingCancelledException: Rendering cancelled, page 1" ...

vue-pdf version: 4.0.8 vue.js version: 2.6.10 webpack version: 4.0.0 browser version: Chrome 80.0.3987.132 OS version: 10.14.6

I tried to use @error listener, but could not catch any error in . Actually everything works, but it is sending lot of sentry errors. In Chrome the errors disappear after loading, (in Safari they are still there after loading)

Any idea how can handle this?

Thanks a lot

chrplanck commented 4 years ago

Facing the exact same issue. @hormiklos - let me know if you've found a workaround, thanks!

dandanzhou commented 4 years ago

me too @hormiklos

wangxv commented 4 years ago

me too image

kishiamy commented 4 years ago

same for me @hormiklos

CoderKwong commented 4 years ago

same for me

jdrzj commented 4 years ago

For me it seems like this problem occurs only when I refresh site with PDF.

Mariah-feifei commented 4 years ago

这个问题解决了吗?

CoderKwong commented 4 years ago

Has anyone solved this problem?

lh1125 commented 4 years ago

我也遇到了同样的问题,如果有很多页中途退出就会导致后面获取不到pdf

agallio commented 4 years ago

I still get this error, waiting for a solution / workaround.

victorybiz commented 4 years ago

Has anyone found a solution for this?

hormiklos commented 4 years ago

Sort of... I am using a different library, which seems ok, at least without this issue :)

pathikmehta commented 4 years ago

Same issue but only in mobile screen resolution. If I open pdf in the browser with the normal resolution it's just fine but when I move to mobile resolutions supported in the chrome dev tool and then open the pdf, it starts showing this errors in the console

shikha-desai commented 4 years ago

I tried to catch the exception after call to pdfRender.cancel() in the method renderPage in file pdfjsWrapper.js and that stopped the error logs. I think vue-pdf team should introduce this kind of catch clause at appropriate place. To verify, I inserted the following line: pdfRender.promise.catch(err => console.log(err)); After https://github.com/FranckFreiburger/vue-pdf/blob/master/src/pdfjsWrapper.js#L193

iuri-gg commented 4 years ago

Getting same issue. Sometimes I get blank pages without content. Has anyone figured out a workaround for this? @hormiklos what library are you using?

hormiklos commented 4 years ago

@ocha pdfvuer works properly... so far...

nullhan commented 4 years ago

me too

BrettBailey commented 3 years ago

me too :-( looks like its stuck in a loop throwing same exception over and over

Anyone have a work around?

BrettBailey commented 3 years ago

I've found a workaround which is to use a paging control to turn the page instead of rendering all pages in a with " v-for="i in numPages"

It's not an ideal solution as I would prefer to scroll but it will suffice whilst waiting on a fix. The pagination control is from bootstrap-vue

 <h3>page count is {{ numPages }}</h3>
    <b-pagination
      v-model="currentPage"
      :total-rows="numPages"
      :per-page="1"
      aria-controls="pdf"
    ></b-pagination>
    <div class="vertScroll">
    <pdf
        :page="currentPage"
        :src="pdfsrc"
      ></pdf>
    </div>
alexdohm commented 3 years ago

Also hoping for a fix for this. This issue also affects usability even if the pdf eventually loads.

The code that I had that lead to this issue

<pdf
    v-for="i in numPages"
    :key="i"
    :src="src"
    :page="i"
></pdf>

...

<script>
...
  created() {
    this.src = pdf.createLoadingTask('./Brochure.pdf')
  },
  mounted() {
    this.src.promise.then(pdf => {
      this.numPages = pdf.numPages;
    });
  },
...
</script>
musicteachj commented 3 years ago

I'm also experiencing this issue.

Similar to above BrettBailey's workaround solution. I've written a workaround pagination solution with Vuetify

<pdf :src="src" :page="page"></pdf>
<div class="sticky">
  <div style="height: 60px; background-color: #fff">
    <v-pagination v-model="page" :length="this.numPages" :total-visible="paginationVisible"></v-pagination>
  </div>
</div>
get paginationVisible() {
  return this.numPages >= 6 ? 6 : this.numPages;
}
WouterSioen commented 3 years ago

Same issue here, any updates? FYI: we fixed it as well by moving to pdf-vuer.

zhouwei517 commented 3 years ago

me too

bastiennoel93 commented 3 years ago

Same error for me. The problem comes from "pdfRender.cancel()" in the renderPage method.

jinggee commented 2 years ago

replace it with pdfvuer

Xiong-Xu commented 2 years ago

replace it with pdfvuer

nice solution

mxismean commented 1 year ago

a3495d10-4b4a-4431-b10c-8db24f15aaac me too

JianlingLuo commented 1 year ago

image

"pdfjs-dist": "2.5.207",
"vue-pdf": "4.2.0",
yang1978u commented 6 months ago

may be is good

Catkin9372 commented 3 months ago

0e4cc522e090b0d1e9e675fc78f6bc6

Catkin9372 commented 3 months ago

Has the problem been solved?

Shang-Bing commented 2 months ago

我给PDF添加固定的高度解决了这个问题,但是我不想固定高度,还有其他方法吗?