我在我的 ANGULAR 站点中使用 ng2-pdfjs-viewer 来查看 PDF。但我的客户要求在工具栏中添加一些更多与网站相关的链接,例如联系我们、导航到其他网站。我认为我们可以使用 PDFViewerApplication 和 PDFViewerApplicationOptions。
有人可以让我如何实现 PDFViewerApplication 和 PDFViewerApplicationOptions 吗?或者请给我一些其他的选择?
我在我的 ANGULAR 站点中使用 ng2-pdfjs-viewer 来查看 PDF。但我的客户要求在工具栏中添加一些更多与网站相关的链接,例如联系我们、导航到其他网站。我认为我们可以使用 PDFViewerApplication 和 PDFViewerApplicationOptions。
有人可以让我如何实现 PDFViewerApplication 和 PDFViewerApplicationOptions 吗?或者请给我一些其他的选择?
为了使用这两种配置,您需要首先创建对“PdfJsViewerComponent”的引用,可能使用 viewchild 作为,
@ViewChild(PdfJsViewerComponent) 公共 PdfJsViewerComponent: PdfJsViewerComponent;
然后上述属性可用于访问或修改现有功能:
this.PdfJsViewerComponent.PDFViewerApplication.(任何可用属性的名称)
此外,要在查看器顶部添加任何额外内容,您可以使用样式position: absolute
并重新定位内容。
此外,要在 pdf/图像上动态添加任何额外内容,可以使用画布。其中 (X,Y) 位置设置为定位元素。