English 中文(简体)
我如何在使用VueJS的网页上使pdf成为一页?
原标题:How do I render a pdf in a page using VueJS?

我试图为某个人建立一个组合网站,并且无法在网上申请或新表格中提供。 pdf的档案是地方性的,因此与查阅无关。

<template> <embed src=”/public/pdfs/myPdf.pdf”类型=“application/pdf”/></template>

这种法典并不奏效,即还尝试了声称已提交pdf(例如jspdf-dist或VuePDF)的金字塔和各种模块。

问题似乎是档案的 f。 Vue似乎并不试图获取当地档案,而是利用当地托管人:接收这些档案的港口/寄托/档案。 我如何对待这一点?

问题回答

您可将pdf档案带至src ,并输入该部件如下:

<template>
  <div>
    <embed style="width: 100vw; height: 100vh" :src="pdf" />
  </div>
</template>

<script setup>
import pdf from "../assets/sample.pdf";
</script>

Demo https://gn33f4.csb.app/





相关问题
How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Extract everything from PDF [closed]

Looking for solution to extract content from a PDF file (using console tool or a library). It will be used on server to produce on-line e-books from uploaded PDF files. Need to extract following ...

PDF compression How does Adobe do it?

This is a bit more of a fun question than a serious one, but how does the Adobe PDF format make documents so... portable? I just created a small Word document, 235kb in size, containing multiple ...

Exporting HTML Tables

How can I export an HTML table in my page as PDF and/or XLS? (preferably using JS (+jquery))

Using Java PDFBox library to write Russian PDF

I am using a Java library called PDFBox trying to write text to a PDF. It works perfect for English text, but when i tried to write Russian text inside the PDF the letters appeared so strange. It ...

HTML --> PDF with PHP [duplicate]

Possible Duplicate: Convert HTML + CSS to PDF with PHP? How can I convert an HTML page (via $cURL or something) to a PDF file?

Free way to convert PDF to XPS with C#

Are there any free tools that I can use to convert a PDF document into an XPS document? Although a nice programmatic API would be nice, I m not opposed to shelling out to a command line tool to do ...

PDF conversion service

I need to develop a service able to convert MS Office and Open Office documents to PDF. And the PDF`s also need to be commentable when opened in ADOBE Reader. I have used a piece of software from www....

热门标签