pdf.js

Using pdf.js exception occur JavaScriptException: (ReferenceError): PDFJS is not defined

北战南征 提交于 2019-12-10 10:53:38
问题 **In html file add script tag** <head> <script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script> </head> <body> <button id="prev" onclick="goPrevious()">Previous</button> <button id="next" onclick="goNext()">Next</button>     <span>Page: <span id="page_num"></span> <span id="page_count"></span></span> </div> <div> <canvas id="the-canvas" width="700" style="border:1px solid black"></canvas> </div> </body> and in client side (pdf.java) call a

Convert pdf to a single page editable html

陌路散爱 提交于 2019-12-09 12:06:59
问题 I have been trying to convert a pdf file to a single nice html page .After surfing about it. The solutions I have got are little bit lacking to my requirements.As I have to create individual html pages for say about 200 pdf files.As online converters might not be a leading solution. So I tried the following solutions along with the requirements not being fulfilled. embed tag of html5 + embeds a pdf into html page nicely. - HTML page is not editable since it simply embeds the pdf to html page.

How to render a pdf file using pdf.js?

痞子三分冷 提交于 2019-12-08 17:37:48
问题 I created an html file with content as below index.html <html> <head> <script type="text/javascript" src="./pdf.js"></script> <script type="text/javascript" src="./hello.js"></script> </head> <body> <canvas id="the-canvas" style="border:1px solid black;"/> </body> </html> hello.js with content PDFJS.disableWorker = true; var pf = PDFJS.getDocument('./helloworld.pdf') pf.then(function(pdf) { pdf.getPage(1).then(function(page) { var scale = 1.5; var viewport = page.getViewport(scale); // //

In PDF.js, how do you hide the canvas and display the underlying text at full opacity?

半城伤御伤魂 提交于 2019-12-08 03:33:30
When PDF.js processes a PDF to HTML5, it lays a <canvas> over all the <div> elements containing the text. This canvas is a proper render of the PDF, while the text underneath is quite rough (but sufficient for certain purposes such as searching for words). Using the PDF.js demo page , I can make the underlying text visible by: Deleting the <canvas> element. Disabling the color: transparent property on the .textLayer class, which acts upon the underlying text. ... However, the text remains low-opacity, and I can't find the CSS that's controlling this effect (see below): Before - with canvas

Uncaught ReferenceError: PDFJS is not defined when initialising PDF.JS

不羁的心 提交于 2019-12-08 03:28:09
问题 I am trying to install PDF.JS in a CMS of sorts where the outer skeleton of the page is built for me, including the reference to jQuery (which is still version 1.10.2). I have tried adding these two lines: <script src="https://mozilla.github.io/pdf.js/build/pdf.js"></script> <script src="https://mozilla.github.io/pdf.js/build/pdf.worker.js"></script> And the running this command: <script> PDFJS.getDocument('/loc/testpdf.pdf'); </script> But they return this error: VM485:14 Uncaught

Task edit document preview component Alfresco

只愿长相守 提交于 2019-12-07 18:14:06
问题 First question: I want to implement a preview of the document in the form of the task-edit of the workflows... How can I do this? I try to adapt the document-details.xml and document-details.ftl to workflow-details.xml and workflow-details.ftl but not works. I tried to copy the components that have web-preview of the document-details files to workflow-details. Any hint to make this? I have this in workflow-details.ftl : <#include "include/alfresco-template.ftl" /> <@templateHeader> <@script

PDF.js How do you print a multi-page pdf?

老子叫甜甜 提交于 2019-12-07 02:15:36
问题 I'm trying to add print functionality to a multi-page PDF embedded in a web page that is using the PDF.js library. It's problematic because I only have one page rendered at a time when a user is viewing it and the page is really rendered as an image in a canvas element. This question does not help in this case because it is for a single page PDF where printing the current contents of the canvas are acceptable. Same with this question. I also want to avoid just opening the PDF in another tab

Using pdf.js with Qt5.8

情到浓时终转凉″ 提交于 2019-12-06 15:54:19
问题 I am trying to make a pdf viewer in Qt5.8 .I know that poppler is a choice for Qt but I want to do this using pdf.js .I dont know how to embed pdf.js with Qt5.8 . I have seen the hello world documentation of pdf.js but it didn't helped. Please help me. Thanks in advance . 回答1: The basic idea would be to have some widget to display HTML if you want to make use of pdf.js - it seems that QWebEngineView (makes use of Chromium) could do the job as it takes a minimum of code to get your first

pdf.js : How can we get the current pdf page number using pdf.js

痴心易碎 提交于 2019-12-06 15:23:07
I want to get the current page number from pdf.js when user Click's some Button.I'm not opening pdf file in iframe like that Below link using iframe I'm using the pdf.js Directly From the GitHub Project My Question is how can I get the Current page Number from pdf.js Marcus Li PDFViewerApplication.pdfViewer.currentPageNumber is a getter and setter . Examples: // Go to page 5 PDFViewerApplication.pdfViewer.currentPageNumber = 5; // Move two pages forward PDFViewerApplication.pdfViewer.currentPageNumber += 2; 来源: https://stackoverflow.com/questions/42439249/pdf-js-how-can-we-get-the-current-pdf

Using pdf.js exception occur JavaScriptException: (ReferenceError): PDFJS is not defined

感情迁移 提交于 2019-12-06 08:49:13
**In html file add script tag** <head> <script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script> </head> <body> <button id="prev" onclick="goPrevious()">Previous</button> <button id="next" onclick="goNext()">Next</button>     <span>Page: <span id="page_num"></span> <span id="page_count"></span></span> </div> <div> <canvas id="the-canvas" width="700" style="border:1px solid black"></canvas> </div> </body> and in client side (pdf.java) call a java script funcion using JSNI alse paste pdf.js file in public folder and call .gwt.xml like **I am just