简体   繁体   English

如何在 Angular 2 中注释 pdf 文件

[英]How to annotate pdf file in Angular 2

I am new to Angular.我是 Angular 的新手。

Currently, I have a application that renders pdf file.目前,我有一个呈现 pdf 文件的应用程序。

I want to annotate/make changes on the pdf file.我想对 pdf 文件进行注释/更改。 Like adding drawings: circle, lines or even text.就像添加绘图:圆形、线条甚至文本。

How can I do that in Angular 2?我怎样才能在 Angular 2 中做到这一点?

You could use the pdf-annotate.js plugin that works on pdf.js .您可以使用适用于pdf.jspdf-annotate.js插件。 It can be used to create the following annotations.它可用于创建以下注释。

  • Area面积
  • Drawing绘图
  • Highlight亮点
  • Point
  • Strikeout三振
  • Textbox文本框

For examples, follow the links inhttps://github.com/instructure/pdf-annotate.js/tree/master/docs .例如,请按照https://github.com/instructure/pdf-annotate.js/tree/master/docs 中的链接操作。

If you need more examples, you can refer to the tests that are available in the render folder.如果需要更多示例,可以参考render文件夹中提供的测试。 Following is an example to render a line.以下是渲染线条的示例。

import renderLine from '../../src/render/renderLine';

let line = renderLine({
      rectangles: [
        {
          x: 25,
          y: 50,
          width: 100
        }
      ]
    });

Adobe's pdf-embed Javascript API can be used to do this. Adobe 的 pdf-embed Javascript API 可用于执行此操作。 It is free to use.它可以免费使用。

https://www.adobe.io/apis/documentcloud/dcsdk/pdf-embed.htmlhttps://www.adobe.io/apis/documentcloud/dcsdk/pdf-embed.html

Check out the demo at查看演示

https://documentcloud.adobe.com/view-sdk-demo/index.html#/view/FULL_WINDOW/Bodea%20Brochure.pdf https://documentcloud.adobe.com/view-sdk-demo/index.html#/view/FULL_WINDOW/Bodea%20Brochure.pdf

It supports text comments, sticky notes, highlighting, and drawing.它支持文本注释、便签、突出显示和绘图。 There is a save callback to save the changes to your own storage.有一个保存回调将更改保存到您自己的存储中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM