Forums

Security policy blocking wand converting PDF to jpeg

Hello,

I am having problem in that my app on pythonanywhere won't convert a pdf to jpeg, It gives this error message:

wand.exceptions.PolicyError: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408

It works fine on my local machine. Anyone know how to fix this?

My guess would be that the PDF contains a reference to an external site, and that site is not on our list of whitelisted sites for free accounts. If you can identify the site in question, and if it provides an official documented public API, then we can consider adding it to the list.

The PDF didn't contain any websites. I rewrote the function using pdf2image instead of wand and it's working now.

Glad you got that working!