# I cannot use PDF.JS Express to open a PDF file by url in a Vue Project, please help me figure out how is that happen

**URL:** <https://pdfjs.community/t/i-cannot-use-pdf-js-express-to-open-a-pdf-file-by-url-in-a-vue-project-please-help-me-figure-out-how-is-that-happen/660>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [March 24, 2021, 5:09am UTC](https://pdfjs.community/t/i-cannot-use-pdf-js-express-to-open-a-pdf-file-by-url-in-a-vue-project-please-help-me-figure-out-how-is-that-happen/660 "2021-03-24T05:09:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Charles](https://pdfjs.community/u/Charles)\
**Post date:** [March 24, 2021, 5:09am UTC](https://pdfjs.community/t/i-cannot-use-pdf-js-express-to-open-a-pdf-file-by-url-in-a-vue-project-please-help-me-figure-out-how-is-that-happen/660/1 "2021-03-24T05:09:50Z")

</div>

**PDF.js Express Version**

**Detailed description of issue**  
{When I download the Vue Demo on the website, I replace the default file path to my own file path, But  
it just can’t work. The console of Chrome give me the error info:“Access to fecth ‘url’ has been blocked by CORS policy”}. It means that the url is on another remote server, pdf.js express can’t open it. However, I have solved the CORS problem to make sure every file can be fetched from every request. I can open the same file in Chrome or any other pdf viewer software. Can anyone help me?

**Expected behaviour**  
{I expecte to open the remote file by url in a Vue Project.}

**Does your issue happen with every document, or just one?**  
{Every document}

**Link to document**  
{[http://119.29.53.191:7069/download-file-0.0.1/download?fileType=PDF\_DOCUMENT&filePath=/usr/local/rgms-resources/document/de0b2446-7092-4b64-8bba-31dd466e7625\_reading02-07.pdf](http://119.29.53.191:7069/download-file-0.0.1/download?fileType=PDF_DOCUMENT&filePath=/usr/local/rgms-resources/document/de0b2446-7092-4b64-8bba-31dd466e7625_reading02-07.pdf)}

**Code snippet**  
{WebViewer({  
path: this.path,  
initialDoc: “[http://119.29.53.191:7069/download-file-0.0.1/download?fileType=PDF\_DOCUMENT&filePath=/usr/local/rgms-resources/document/de0b2446-7092-4b64-8bba-31dd466e7625\_reading02-07.pdf](http://119.29.53.191:7069/download-file-0.0.1/download?fileType=PDF_DOCUMENT&filePath=/usr/local/rgms-resources/document/de0b2446-7092-4b64-8bba-31dd466e7625_reading02-07.pdf)”,  
// replace with your own PDF file  
}, this.$refs.viewer).then((instance) =\> {  
// call apis here  
});

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [March 24, 2021, 5:09am UTC](https://pdfjs.community/t/i-cannot-use-pdf-js-express-to-open-a-pdf-file-by-url-in-a-vue-project-please-help-me-figure-out-how-is-that-happen/660/2 "2021-03-24T05:09:52Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

- [CoreControls - setWorkerPath(path)](https://pdfjs.express/api/CoreControls.html#.setWorkerPath__anchor)
- [CoreControls - isDemoMode()](https://pdfjs.express/api/CoreControls.html#.isDemoMode__anchor)
- [Offline use of viewer - Cache files](https://pdfjs.express/documentation/viewer/offline-loading#cache-files)
- [Forwarding headers](https://pdfjs.express/documentation/utils/headers)
- [Events for PDF.js Express](https://pdfjs.express/documentation/learn-more/events)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [March 25, 2021, 3:22pm UTC](https://pdfjs.community/t/i-cannot-use-pdf-js-express-to-open-a-pdf-file-by-url-in-a-vue-project-please-help-me-figure-out-how-is-that-happen/660/3 "2021-03-25T15:22:20Z")

</div>

Hi there,

The URL you provided leads to an error page, so I’m guessing that that’s the problem. Please make sure your document is available at that URL.

Thanks!  
Logan
