Hi,
I am trying to add my own stamp amongst the provided stamp of the annotation section.
I have achieved it by using customStampSettings.customStamp and customStampSettings.isAddToMenu properties but as soon as I add this stamp to the PDF, I am no longer able to use functions such a download() or saveAsBlob().
Instead, this error dialogue show up
and by using my network tab I see that the server has returned this
The thing is that it doesn't say it if I remove the stamp. I was wondering if I am doing something wrong or if the dotnet back-end server might have a problem.
I have tried it in my work environment with our own instance of the server running the latest version and on a Stackbliz using an official server link and in both cases, I got the same response from the server.
Thanks in advance
ngAfterViewInit(): void {
this.pdfViewer.customStampSettings.isAddToMenu = true;
this.pdfViewer.customStampSettings.customStamps = [
{
customStampImageSource:
'Base64string’,
customStampName: 'Test'
}
];
}
|
Thanks for the reply !
It works well both for the download and the saveAsBlob functions but it seems that the stamps are not rendered properly if I save the file using saveAsBlob and then I re-open it in the PDFViewer. (They are their in the file itself when opened normally) I am saving it in ASW s3 cloud service in case it helps.
Do you have an idea what could be the cause?
Thanks for the sample.
After trying a few thing I noticed that the base64 image I was using in me real use-case was generated as a png. I'm using a canvas to get dynamic image (I need the time-stamp) and the canvas.toDataURL() function returned png by default. Strangely, it worked for the most part but adding these parameters fixed it for good canvas.toDataURL('image/jpeg', 1)
Sorry for not looking into it a bit more