Load pdf on foreign url with pdf.js
I resolved this issue by comment this lines in viewer.js
if (fileOrigin !== viewerOrigin) {
throw new Error('file origin does not match viewer\'s');
}
and use proxy like this. http://192.168.0.101/web/viewer.html?file=https://cors-anywhere.herokuapp.com/pathofpdf.pdf
Add your domain/origin to HOSTED_VIEWER_ORIGINS
array