Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

CORS error for 21 version Options
jshi
Posted: Monday, July 19, 2021 2:41:31 PM
Rank: Newbie
Groups: Member

Joined: 7/15/2019
Posts: 4
After updating to 21 version, we start to get the cors error below when converting HTML to pdf.
We load font in html as this <link rel="stylesheet" href="https://use.typekit.net/vok2dsn.css">, and we don't see any error rendering html in browser.
Web page loading JavaScript error: Access to font at 'https://use.typekit.net/af/437c3d/00000000000000003b9b0932/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n3&v=3' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
Any idea how to solve this?
Thanks.
Jack Cheng
Posted: Monday, July 19, 2021 3:41:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,036
Hi,

We tested this CSS link here and it works fine. Where do you see the "Web page loading JavaScript error" message?

Thanks
jshi
Posted: Monday, July 19, 2021 3:49:44 PM
Rank: Newbie
Groups: Member

Joined: 7/15/2019
Posts: 4
Hi, I see this error in WebViewCallback().OnConsolMessage(), it shows as a javascript console error.
Jack Cheng
Posted: Wednesday, July 21, 2021 1:44:45 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,036
Hi,

Can you try to isolate the problem into a test project and send the test project to us? See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Jack Cheng
Posted: Friday, July 23, 2021 10:35:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,036
Hi,

We have looked into the test project you sent to us. The root of the problem is you have HtmlToPdfOptions.NoCache set to true. Setting this property to true would trigger the CORS preflight request, which the server would response with an 404 error code. This would terminate the request in its preflight stage. To avoid this problem, you would need to remove the line that sets NoCache to true.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.