英文:
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
英文:
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.
答案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
},
]
}
});
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论