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

throw InvalidPDFException error and the page is blank

Open LucyLiuluxi opened this issue 6 years ago • 5 comments

my code

<template>
    <pdf :src="url"></pdf>
</template>
<script>
import pdf from 'vue-pdf'

export default {
    components: {
        pdf
    },
    data () {
        return {
           url: 'fileUrl******'
        }
    }
}
</script>

console shows the error:

message: "Invalid PDF structure"
​
name: "InvalidPDFException"

but I can directly open id in chrome.

If I use the vue-pdf in a wrong way?

Look for help eagerly waiting!

LucyLiuluxi avatar Jul 29 '18 04:07 LucyLiuluxi

I have the same question,did you solved this problem?

huoruji avatar Jul 10 '19 07:07 huoruji

I have the same question,did you solved this problem?

webxiaohao avatar Jul 22 '19 07:07 webxiaohao

Any fix for this?

himat avatar Aug 29 '20 17:08 himat

I had this problem and I used redirect. const redirectTo = 'mypagepdf' window.location.replace("/"+ redirectTo);

gpcodex avatar Dec 09 '20 16:12 gpcodex

I´m having the same problem. image

@gpcodex how did you apply this in the context of vue and the code above? How did you get the pdf vue library to generate the pdf.

I seem to have this problem only when I have a parameter in my url. i.e.

On another file you click on the below:

Download PDF

It goes to a new route which has this component:

If anyone has any idea as to why this happens, I´d be really grateful!

maze02 avatar Dec 07 '21 23:12 maze02