我正在开发一个从Michael Beale 发布的示例开始的PDF查看器。它可以很好地处理大量不同类型的文档。我的问题是,加载不止一次由TEKLA导出为PDF的2d模型,第一次运行良好,但以下失败在控制台上显示错误:
font-engine.js:51 Failed to map font Arial
value @ font-engine.js:51
value @ font-engine.js:59
value @ LmvCanvasContext.js:594
paintChar @ pdf.js:11506
showText @ pdf.js:11635
executeOperator
这是PDF.js站点
https://github.com/mozilla/pdf.js
我正在搜索和阅读大量文章,大部分编码都是将pdf导入pdf.js并在浏览器上显示,我无法理解PDF.js是否能够在不下载pdf文件的情况下在web浏览器上创建PDF格式和显示?
这是我找到的示例代码:
'use strict';
//
// Fetch the PDF document from the URL using promises
//
PDFJS.getDocument('helloworld.pdf').then(function(pdf) {
// U
我正在尝试使用pdf.js来显示pdfs。我已经可以显示一个pdf,但文本选择没有启用。有人能给出一个关于如何在pdf.js中启用文本选择的小例子吗?
我已经试过几件事了,但没有成功。
我的代码当前如下所示:
PDFJS.getDocument('someRandom.pdf').then(function(pdf){
pdf.getPage(1).then(function(page) {
// you can now use *page* here
var scale = 1.5;
var viewport = page.getViewport(
我正在开发一个镀铬扩展。我想知道的是,弹出窗口可以显示pdf中的文本。我搜索了PDF.js,并在chrome扩展的backgroud.js中编写了以下代码进行测试:
‘use strict’;
var pdf = PDFJS.getDocument('http://www.pacer.gov/documents/pacermanual.pdf');
var pdf = PDFJS.getDocument('pacermanual.pdf');
pdf.then(function(pdf) {
var maxPages = pdf.p
我已经在Google Scripts上工作了一段时间,但我似乎找不到解决我的问题的方法。我要做的是用我的calculateRates()函数将电子表格中两个单元格的内容相乘。下面是我的代码:
/**
@customFunction
*/
function calculateRates(hourDecimal, personRate) {
var ss = SpreadsheetApp.getActiveSpreadsheet(); //Access spreadsheet
var sheet = ss.getSheets()[0]; //Access sheet
var ra
我想预览pdf作为画布,但我不能导入pdfjs在我的项目。
我已经使用$yarn add pdfjs-dist安装了pdfjs
我还需要进口别的东西吗?
import pdfjsLib from "pdfjs-dist/build/pdf"; //<-- Here is the problem.
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://mozilla.github.io/pdf.js/build/pdf.worker.js';
Could not find a declaration file
请帮助,我尝试了很多解决方案,逐个显示所有页面,但是我得到了不同的错误,所以现在我使用了pdfjs的演示代码及其为one page所做的工作,有人知道如何显示所有页面吗?
我试过这个解决方案,但不适合我
// If absolute URL from the remote server is provided, configure the CORS
// header on that server.
var url = 'demo.pdf';
// Loaded via <script> tag, create shortcut to access PDF.
我正在尝试编写一个chrome扩展来实现PDFJS从PDF中提取数据。我可以在读取本地文件时实现这一点,但我希望在浏览器中解析当前正在查看的PDF。
我收到了大量的以下错误:
'Warning: Ignoring invalid character "33" in hex string'
'Warning: Ignoring invalid character "79" in hex string'...
然后
"Error
at InvalidPDFExceptionClosure (chrome-extensi