1 Star 0 Fork 2

mfkvfhpdx / pdf-annotate.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

此项目对github上pdf-annotate.js的一个修改版本,修改内容见下:

  • 文档和api汉化。
  • scripts脚本增加了window。
  • weblegacy文件夹下为不需要打包的一个版本,直接拷贝就能用(通过npm run startlegacy启动服务可见效果),并且支持稍老版本的浏览器(原版本chrome80以下会报错)。

@submitty/pdf-annotate.js

Build Status npm version codecov

PDF.js的注释层。

结合了已归档的instructure/pdf-annotate.js和已删除的DynamicEnvironmentSystems/pdf-annotate.js的分支。正在积极开发以供Submitty使用。

要报告pdf-annotate.js的问题,请将其提交到Submitty/Submitty存储库中。

目标

  • PDF.js提供低级别的注释层。
  • 可选的高级UI用于管理注释。
  • 不依赖后端,只需提供自己的StoreAdapter以获取/存储数据。
  • 规定注释格式。

安装

npm install @submitty/pdf-annotate.js

示例

import pdfjsLib from 'pdfjs-dist/build/pdf';
import PDFJSAnnotate from 'pdfjs-annotate';

const { UI } = PDFJSAnnotate;
const VIEWER = document.getElementById('viewer');
const RENDER_OPTIONS = {
  documentId: 'MyPDF.pdf',
  pdfDocument: null,
  scale: 1,
  rotate: 0
};

pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdf.worker.js';
PDFJSAnnotate.setStoreAdapter(new PDFJSAnnotate.LocalStoreAdapter());

pdfjsLib.getDocument(RENDER_OPTIONS.documentId).promise.then((pdf) => {
  RENDER_OPTIONS.pdfDocument = pdf;
  VIEWER.appendChild(UI.createPage(1));
  UI.renderPage(1, RENDER_OPTIONS);
});

请参阅/web以获取用于注释PDF的示例Web客户端。

文档

查看文档.

开发

# 克隆存储库
$ git clone https://github.com/Submitty/pdf-annotate.js.git
$ cd pdf-annotate.js

# 安装依赖项
$ npm install

# 启动示例服务器
$ npm start
$ open http://127.0.0.1:8080

# 运行测试
$ npm test

# 对代码进行lint检查
$ npm run lint
The MIT License (MIT) Copyright (c) 2015-2018 Matt Zabriskie Copyright (c) 2018-2019 Submitty Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

此项目对github上[pdf-annotate.js](https://github.com/Submitty/pdf-annotate.js)的一个修改版本,其中说明文档内容增加了汉化,scripts脚本增加了window。 展开 收起
JavaScript 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/mfkvfhpdx/pdf-annotate.js.git
git@gitee.com:mfkvfhpdx/pdf-annotate.js.git
mfkvfhpdx
pdf-annotate.js
pdf-annotate.js
master

搜索帮助