pdfjs

Load pdf from server and embed in Vue app

守給你的承諾、 提交于 2021-02-10 18:38:27
问题 I have an api which returns a pdf file. I'm trying to display this in vue.js and found the vue-pdf component which looks like it should do the job. Here's the project on github I'm able to call the API and get the binary response but I've not been able to convert the binary data into something which the vue-pdf library can display. The documentation for the :src prop is here My vue code is below with a few of the failed attempts commented out. <template> <pdf :src="pdfsrc"></pdf> </template>

React and PDF.js changing page doesn't work when I render whole document

前提是你 提交于 2021-01-28 09:50:42
问题 I'm trying to render PDF file in my web application in React using PDF.js library. There is so much different information out there, even in the official git, so I'm stuck with trying to render the whole pdf document and also have the function to go to particular page. This is what I have for now: import * as pdfWorker from 'pdfjs-dist/build/pdf.worker' import PdfJsLib from 'pdfjs-dist'; import 'pdfjs-dist/web/pdf_viewer.css'; import * as pdfjsViewer from 'pdfjs-dist/web/pdf_viewer'; ...

React and PDF.js changing page doesn't work when I render whole document

依然范特西╮ 提交于 2021-01-28 09:32:59
问题 I'm trying to render PDF file in my web application in React using PDF.js library. There is so much different information out there, even in the official git, so I'm stuck with trying to render the whole pdf document and also have the function to go to particular page. This is what I have for now: import * as pdfWorker from 'pdfjs-dist/build/pdf.worker' import PdfJsLib from 'pdfjs-dist'; import 'pdfjs-dist/web/pdf_viewer.css'; import * as pdfjsViewer from 'pdfjs-dist/web/pdf_viewer'; ...

PDF.JS How to make pdf-js viewer canvas responsive?

孤者浪人 提交于 2020-12-05 07:05:29
问题 I have to display PDF using PDFJS library on my page. The problem is that since I give the scale as a fixed number canvas in which PDF is rendered is not responsive and does not fit the bootstrap grid column width. Here is HTML code: <div class="row"> <div class="col-md-1" style="padding-right: 15px;"> <input type="button" ng-click="openPreviousPage()"/> </div> <div class="col-md-8"> <canvas id="the-canvas" style="border: 1px solid black;"></canvas> </div> <div class="col-md-1 col-md-offset-2

PDF.JS How to make pdf-js viewer canvas responsive?

半腔热情 提交于 2020-12-05 07:04:58
问题 I have to display PDF using PDFJS library on my page. The problem is that since I give the scale as a fixed number canvas in which PDF is rendered is not responsive and does not fit the bootstrap grid column width. Here is HTML code: <div class="row"> <div class="col-md-1" style="padding-right: 15px;"> <input type="button" ng-click="openPreviousPage()"/> </div> <div class="col-md-8"> <canvas id="the-canvas" style="border: 1px solid black;"></canvas> </div> <div class="col-md-1 col-md-offset-2

Loading PDF in Canvas and Drawing rectangles

落爺英雄遲暮 提交于 2020-04-30 10:07:36
问题 I am trying to build a web page to display a PDF file inside canvas and allow user to draw rectangles. Below is the code I'm trying. The problem is mouse event is going outside canvas also. How to restrict mouse dragging event only inside the canvas. var url = 'https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/examples/learning/helloworld.pdf'; //Loaded via <script> tag, create shortcut to access PDF.js exports. var pdfjsLib = window['pdfjs-dist/build/pdf']; // The workerSrc property