I’m having some difficulty importing an image into pdf.js and maintaining the quality of the image because I need to resize it, is there any way I can import an svg.
I just tried with the code provided to import an SVG and it looks look in the Express viewer.
Could you provide screenshots to show the quality of the image and the URL for the SVG you’re using for the stamp image data?
Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
zone.js:1063 Unhandled Promise rejection: File extension svg is not supported. Please see PDFTron Systems Inc. | Documentation for a full list of file formats supported by WebViewer.
Thanks for the code snippet. I was having some issues on my local host with fetching the URL you sent so I uploaded the image to our AWS. Was able to get the stamp to use that SVG using the PDFTron AWS link.
Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
I managed to make it work, but I needed to launch a loading screen, as the function that loads the image stampAnnot.setImageData file takes a while to be processed, and does not display anything in the system during loading
the command didn’t work
this.instance.openElements([‘loadingModal’]);
Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
The issue I think is not await the setImageData call. If you await that line it should open the loading modal.
Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here