Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some png not working #2820

Closed
Ruubber opened this issue Dec 8, 2024 · 1 comment
Closed

Some png not working #2820

Ruubber opened this issue Dec 8, 2024 · 1 comment

Comments

@Ruubber
Copy link

Ruubber commented Dec 8, 2024

Hello,
This png image not working with this lib.
https://de7r26jwjif71.cloudfront.net/schools%2F1%2Fprofile%2Fbcf84e3b-778a-4ae4-830c-fd591bf82470.png

I try another many image every image work only this image not work.
I use playground.
Can check issue with this code.

// playground requires you to assign document definition to a variable called dd

var dd = {
	content: [
		{
          image: "snow",
          width: 150,
          height: 50,
          fit: [150, 50],
          alignment: 'center',
        }
	],
	images: {
	    snow: "https://de7r26jwjif71.cloudfront.net/schools%2F1%2Fprofile%2Fbcf84e3b-778a-4ae4-830c-fd591bf82470.png"
	}
	
}
@liborm85
Copy link
Collaborator

liborm85 commented Dec 8, 2024

In browser error log:
Access to XMLHttpRequest at 'https://de7r26jwjif71.cloudfront.net/schools%2F1%2Fprofile%2Fbcf84e3b-778a-4ae4-830c-fd591bf82470.png' from origin 'http://pdfmake.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The website de7r26jwjif71.cloudfront.net is blocking the request due to the CORS policy. To resolve this, you need to include the Access-Control-Allow-Origin header in the image response to allow cross-origin requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants