在Angular组件内,我如何使用Grapecity GcPdfViewer创建自定义印章?

huangapple go评论105阅读模式
英文:

Inside the Angular component, how do I create a custom stamp using the Grapecity GcPdfViewer?

问题

当用户在GcPdfViewer中打开PDF时,他们需要用一个图片来盖章在PDF上,图片的文件路径将在src/assets文件夹中,但是这个网页上的示例不起作用?是否有人可以为我提供一个可用的示例?

我得到的错误是"(TS) 类型缺少属性。

链接:https://www.grapecity.com/documents-api-pdfviewer/demos/editor-features/annotation-editor/stamp-annotations/client-predefined-stamps/purejs

在Angular组件内,我如何使用Grapecity GcPdfViewer创建自定义印章?

英文:

When the User opens a Pdf inside the GcPdfViewer, they need to stamp the Pdf with an image, the image filepath will be in the src/assets folder, but the example from this web page does not work? Can someone provide me with a working example?

There error i'm getting is "(TS) Type is missing properties.

https://www.grapecity.com/documents-api-pdfviewer/demos/editor-features/annotation-editor/stamp-annotations/client-predefined-stamps/purejs

在Angular组件内,我如何使用Grapecity GcPdfViewer创建自定义印章?

答案1

得分: 0

以下是翻译好的部分:

"this.viewer = new GcPdfViewer("#viewer", {
workerSrc: "//node_modules/@grapecity/gcpdfviewer/gcpdfviewer.worker.js",
//supportApi: {
// apiUrl: "api/pdf-viewer",
// token: "support-api-demo",
// webSocketUrl: false
//},
stamp: {
stampCategories: [
{
name: 'Custom Stamps',
stampImageUrls: [
'/path/to/your/custom/stamp1.png',
'/path/to/your/custom/stamp2.png',
'/path/to/your/custom/stamp3.png',
// Add more custom stamp image URLs as needed
],
id: '1234',
stampImages: [],
isDynamic: true,
dpi: 90
},
]
}
});"

英文:
  1. The following syntax fixed the errors ...
  2. this.viewer = new GcPdfViewer("#viewer", {
  3. workerSrc: "//node_modules/@grapecity/gcpdfviewer/gcpdfviewer.worker.js",
  4. //supportApi: {
  5. // apiUrl: "api/pdf-viewer",
  6. // token: "support-api-demo",
  7. // webSocketUrl: false
  8. //},
  9. stamp: {
  10. stampCategories: [
  11. {
  12. name: 'Custom Stamps',
  13. stampImageUrls: [
  14. '/path/to/your/custom/stamp1.png',
  15. '/path/to/your/custom/stamp2.png',
  16. '/path/to/your/custom/stamp3.png',
  17. // Add more custom stamp image URLs as needed
  18. ],
  19. id: '1234',
  20. stampImages: [],
  21. isDynamic: true,
  22. dpi: 90
  23. },
  24. ]
  25. }
  26. });

huangapple
  • 本文由 发表于 2023年5月25日 20:44:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76332410.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定