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

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

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
},
]
}
});"

英文:
The following syntax fixed the errors ... 

  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
                    },
                ]
            }
        });

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:

确定