pdf.js

How to pass blob to the viewer.js in PDF.js and how to display pdf in separate window

痞子三分冷 提交于 2020-03-28 06:41:22
问题 I have loaded the pdf in canvas but unable to pass it to viewer.js in PDF.js. Examples only show how to pass to canvas not to viewer.js and i want to load the pdf in different window 回答1: PDF.js comes with a viewer. You can embed an iframe/frame in your page, or open a new window. The url will be the same for both: pdfjs/web/viewer.html?file=URL_TO_YOU_PDF You can also pass binary data: // atob() is used to convert base64 encoded PDF to binary-like data. // (See also https://developer.mozilla

How can I get metadata from pdf document using pdf.js

∥☆過路亽.° 提交于 2020-02-20 04:55:04
问题 Is there any way to get metadata from pdf document like author or title using pdf.js? In this example : http://mozilla.github.io/pdf.js/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf <div class="row"> <span data-l10n-id="document_properties_author"> Autor: </span> <p id="authorField"> - </p> And the authorField is empty. Is there any way to get this info? 回答1: Using just the PDF.js library without a thirdparty viewer, you can get metadata like so, utilizing promises. PDFJS

How can I get metadata from pdf document using pdf.js

痞子三分冷 提交于 2020-02-20 04:53:33
问题 Is there any way to get metadata from pdf document like author or title using pdf.js? In this example : http://mozilla.github.io/pdf.js/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf <div class="row"> <span data-l10n-id="document_properties_author"> Autor: </span> <p id="authorField"> - </p> And the authorField is empty. Is there any way to get this info? 回答1: Using just the PDF.js library without a thirdparty viewer, you can get metadata like so, utilizing promises. PDFJS

How can I get metadata from pdf document using pdf.js

孤街醉人 提交于 2020-02-20 04:52:18
问题 Is there any way to get metadata from pdf document like author or title using pdf.js? In this example : http://mozilla.github.io/pdf.js/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf <div class="row"> <span data-l10n-id="document_properties_author"> Autor: </span> <p id="authorField"> - </p> And the authorField is empty. Is there any way to get this info? 回答1: Using just the PDF.js library without a thirdparty viewer, you can get metadata like so, utilizing promises. PDFJS

How can I get metadata from pdf document using pdf.js

别等时光非礼了梦想. 提交于 2020-02-20 04:52:05
问题 Is there any way to get metadata from pdf document like author or title using pdf.js? In this example : http://mozilla.github.io/pdf.js/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf <div class="row"> <span data-l10n-id="document_properties_author"> Autor: </span> <p id="authorField"> - </p> And the authorField is empty. Is there any way to get this info? 回答1: Using just the PDF.js library without a thirdparty viewer, you can get metadata like so, utilizing promises. PDFJS

Qt 5.8 and Pdf.js error

China☆狼群 提交于 2020-01-21 23:02:21
问题 I have a problem with pdf.js and Qt 5.8, i tried to do the same code in this link Using pdf.js with Qt5.8 in my application but he doesn't work i dont know why, qt show me this message about JS : "js: Uncaught TypeError: Cannot read property 'PDFJS' of undefined". this is my code in mainwindow : QWebEngineView *view; QString pdfFileURL; QString pathToPDFjs = QString("file:///"+qApp->applicationDirPath()+"/libraries/PDF/viewer.html"); pdfFileURL = "file:///C:/Users/Administrateur/Desktop/CV

Qt 5.8 and Pdf.js error

陌路散爱 提交于 2020-01-21 23:02:07
问题 I have a problem with pdf.js and Qt 5.8, i tried to do the same code in this link Using pdf.js with Qt5.8 in my application but he doesn't work i dont know why, qt show me this message about JS : "js: Uncaught TypeError: Cannot read property 'PDFJS' of undefined". this is my code in mainwindow : QWebEngineView *view; QString pdfFileURL; QString pathToPDFjs = QString("file:///"+qApp->applicationDirPath()+"/libraries/PDF/viewer.html"); pdfFileURL = "file:///C:/Users/Administrateur/Desktop/CV

Qt 5.8 and Pdf.js error

时光总嘲笑我的痴心妄想 提交于 2020-01-21 23:01:38
问题 I have a problem with pdf.js and Qt 5.8, i tried to do the same code in this link Using pdf.js with Qt5.8 in my application but he doesn't work i dont know why, qt show me this message about JS : "js: Uncaught TypeError: Cannot read property 'PDFJS' of undefined". this is my code in mainwindow : QWebEngineView *view; QString pdfFileURL; QString pathToPDFjs = QString("file:///"+qApp->applicationDirPath()+"/libraries/PDF/viewer.html"); pdfFileURL = "file:///C:/Users/Administrateur/Desktop/CV

How can I get the current PDF page number from PDF.js iframe?

﹥>﹥吖頭↗ 提交于 2020-01-21 08:55:51
问题 I have the viewer hosted on my local webserver and the iframe points and loads up the pdf. I then want to press a button that 'logs' the page number to a text file, I read this question and answer which seems to suggest you can use pdf.getPage to get the page number but how can i access the PDFJS when it is being ran from inside of the iframe? Thank you. 回答1: var iFrame = document.getElementById('iframe_id'); if ( iFrame.contentDocument ) { currentPageNum= iFrame.contentDocument

Display line breaks as `\n` in pdf to text conversion using pdf.js

左心房为你撑大大i 提交于 2020-01-15 19:12:38
问题 I used the code from this tutorial http://ourcodeworld.com/articles/read/405/how-to-convert-pdf-to-text-extract-text-from-pdf-with-javascript to set up the pdf to text conversion. Looked all over on this site https://mozilla.github.io/pdf.js/ for some hints as to how to format the conversion, but couldn't find anything. I am just wondering if anyone has any idea of how to display line breaks as \n when parsing text using pdf.js. Thanks in advance. 回答1: In PDF there no such thing as