【问题标题】:How to implement PDFViewerApplication and PDFViewerApplicationOptions in ng2-pdfjs-viewer如何在 ng2-pdfjs-viewer 中实现 PDFViewerApplication 和 PDFViewerApplicationOptions
【发布时间】:2021-09-07 05:11:07
【问题描述】:

我在我的 ANGULAR 网站中使用 ng2-pdfjs-viewer 来查看 PDF。但是我的客户要求在工具栏中添加一些更多与网站相关的链接,例如联系我们、导航到其他网站。我认为我们可以使用 PDFViewerApplication 和 PDFViewerApplicationOptions。

谁能告诉我如何实现 PDFViewerApplication 和 PDFViewerApplicationOptions?或者请给我一些其他选择?

【问题讨论】:

  • 您是否成功公开了 PDFViewerAppplication 和 ApplicationOptions,我有类似的要求,需要使用 Angular 构建自定义查看器。任何反馈将不胜感激。

标签: angular pdfjs ng2-pdfjs-viewer pdfjs-dist


【解决方案1】:

为了同时使用这两种配置,您需要先创建对“PdfJsViewerComponent”的引用,可能使用 viewchild 作为,

@ViewChild(PdfJsViewerComponent) public PdfJsViewerComponent: PdfJsViewerComponent;

然后上述属性可用于访问或修改现有功能:

this.PdfJsViewerComponent.PDFViewerApplication.(任何可用属性的名称)

还可以在查看器顶部添加任何额外内容,您可以使用样式position: absolute 并重新定位内容。

还可以在 pdf/图像上动态添加任何额外内容,也可以使用画布。其中 (X,Y) 位置设置为定位元素。

【讨论】:

  • pdfjs dist 文件夹没有 PDFViewerapplication 模块,请告诉我们如何包含其他模块,例如 PDFViewerApplication、PDFViewerApplicationOptions、光标工具、注释等。
猜你喜欢
  • 2021-01-01
  • 1970-01-01
  • 2020-08-08
  • 2019-11-12
  • 2020-04-24
  • 2020-01-27
  • 2020-05-06
  • 2019-11-11
  • 2020-02-06
相关资源
最近更新 更多