vue-pdf icon indicating copy to clipboard operation
vue-pdf copied to clipboard

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

Open hormiklos opened this issue 5 years ago • 32 comments

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

hormiklos avatar Mar 18 '20 23:03 hormiklos

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

chrplanck avatar Mar 23 '20 10:03 chrplanck

me too @hormiklos

dandanzhou avatar Mar 24 '20 11:03 dandanzhou

me too image

wangxv avatar Mar 27 '20 01:03 wangxv

same for me @hormiklos

kishiamy avatar May 12 '20 10:05 kishiamy

same for me

CoderKwong avatar May 15 '20 06:05 CoderKwong

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

jdrzj avatar May 26 '20 15:05 jdrzj

这个问题解决了吗?

Mariah-feifei avatar May 27 '20 10:05 Mariah-feifei

Has anyone solved this problem?

CoderKwong avatar May 28 '20 08:05 CoderKwong

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

lh1125 avatar Jun 23 '20 02:06 lh1125

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

agallio avatar Aug 07 '20 08:08 agallio

Has anyone found a solution for this?

victorybiz avatar Aug 31 '20 01:08 victorybiz

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

hormiklos avatar Aug 31 '20 19:08 hormiklos

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

pathikmehta avatar Sep 24 '20 05:09 pathikmehta

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

shikha-desai avatar Sep 30 '20 14:09 shikha-desai

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

iuri-gg avatar Oct 30 '20 16:10 iuri-gg

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

hormiklos avatar Oct 30 '20 20:10 hormiklos

me too

nullhan avatar Nov 02 '20 09:11 nullhan

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

Anyone have a work around?

BrettBailey avatar Dec 15 '20 20:12 BrettBailey

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>

BrettBailey avatar Dec 16 '20 11:12 BrettBailey

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>

alexdohm avatar Jan 11 '21 10:01 alexdohm

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;
}

musicteachj avatar Feb 15 '21 13:02 musicteachj

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

WouterSioen avatar Mar 11 '21 09:03 WouterSioen

me too

zhouwei517 avatar Mar 13 '21 03:03 zhouwei517

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

bastiennoel93 avatar May 18 '21 16:05 bastiennoel93

replace it with pdfvuer

jinggee avatar Dec 28 '21 06:12 jinggee

replace it with pdfvuer

nice solution

Xiong-Xu avatar Jun 16 '22 09:06 Xiong-Xu

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

mxismean avatar Feb 16 '23 10:02 mxismean

image

"pdfjs-dist": "2.5.207",
"vue-pdf": "4.2.0",

JianlingLuo avatar Mar 02 '23 05:03 JianlingLuo