View PDF on Nuxt page

Viewed 3517

I have a Nuxt app and I want to display on a certain page e.g. /gdpr a PDF file with the GDPR policy. I tried to put the PDF in the static folder, but having something like /gdpr.pdf simply won't do.

I couldn't find a proper way to do this without any PDF viewer plugin and the vue-pdf one has lots of problems with Nuxt.

Any ideas or some other way of implementing this?

1 Answers

You can simply embed your PDF in your page:

<template>
    <div>
        <embed src="/pdf/your_pdf_file.pdf" width="1440px" height="900px" />
    </div>
</template>

I put my pdf file in the pdf folder in my static folder of the project.

Related