I’m using kendo.drawing to generate a PDF that includes an image from Amazon S3, but the image doesn’t display in the generated PDF. However, when I use a direct image URL (like this one), the image shows up fine.
Here are the details:
Working Image URL (from CDN):
https://cdn.redandblue.com/ogx/web/images/logo-alt-b.png
S3 Image URL:
https://s3.amazonaws.com/officegx/Dev/394eaf7e-d62e-49ff-9434-8ee5e690ae7f/logos/8f6a289f-5198-464a-8a55-0cffcb7f09fd-638693276419413618-image1.jpg
The S3 image works fine in the browser, but when I try to embed it in the PDF, it doesn’t display.
What I’ve Tried:
Verified that the image is publicly accessible by checking the S3 object permissions.
The S3 URL is HTTPS and correctly formatted.
I’ve tested the S3 URL in the browser, and the image loads fine.
I’ve also tried configuring CORS for my S3 bucket to allow cross-origin requests.
Here is the function I’m using for PDF download:
function getPDF(data) {
let selector = $(data).parent().parent().parent()[0];
kendo.drawing.drawDOM($(selector)).then(function(group) {
kendo.drawing.pdf.saveAs(group, "@fileName");
$(".print").show();
$("#showBankDetails").show();
});
}
Can anyone suggest why the image doesn’t appear in the PDF and how I can fix it?
Uday Kiran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.