# Invalid PDF structure when opening file without .pdf extension

**URL:** https://pdfjs.community/t/invalid-pdf-structure-when-opening-file-without-pdf-extension/3415
**Category:** Technical Support
**Tags:** pdfjs-express
**Created:** [August 21, 2024, 5:18am UTC](https://pdfjs.community/t/invalid-pdf-structure-when-opening-file-without-pdf-extension/3415 "2024-08-21T05:18:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sunil](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Sunil](https://pdfjs.community/u/Sunil)
#### Post date: [August 21, 2024, 5:18am UTC](https://pdfjs.community/t/invalid-pdf-structure-when-opening-file-without-pdf-extension/3415/1 "2024-08-21T05:18:10Z")

</div>

**Which product are you using?**  
PDF.js Express Viewer

**PDF.js Express Version**  
8.7.5

**Detailed description of issue**  
I have integrated PDF JS express in my project by using manual setup mentioned in [PDF.js Express Plus Download & Integration | Documentation](https://pdfjs.express/documentation/get-started/manually).  
By completing this steps i can open the demo PDF link provided by PDF JS  
ex :  
`https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf`

I have encountering issue while using the PDF.js Express library. Specifically, I am experiencing problems when trying to open PDF files that do not have the .pdf file extension.

The issue is that when I attempt to load a file that does not have the .pdf extension, I am receiving an “Invalid PDF structure” error. This occurs for files that I have confirmed are valid PDF documents.

PDF link example : [http://localhost:8080/app/mobileApp/mobileAppPdfViewer.jsp?file=%2Fapp%2FeBillViewerServlet%3Fkey%3DdYiE7hEhQBLIMimF4EH9fWlOHD9dOw08bK8sHp41WtmTc3ctyVLs5W%252BJVHQZr3o%252FK6aF2kUFtUnJznI36XCV0sp52nz95h5t5fPsePWunh4%253D](http://localhost:8080/app/mobileApp/mobileAppPdfViewer.jsp?file=%2Fapp%2FeBillViewerServlet%3Fkey%3DdYiE7hEhQBLIMimF4EH9fWlOHD9dOw08bK8sHp41WtmTc3ctyVLs5W%252BJVHQZr3o%252FK6aF2kUFtUnJznI36XCV0sp52nz95h5t5fPsePWunh4%253D)

**Expected behaviour**  
PDF should be load without giving invalid PDF structure error

**Does your issue happen with every document, or just one?**  
It does happen with the same type of PDF URL link

**Link to document**

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/c/ceb8009617c65ff2ebcc24b4a50465fb57602172.png)

Thanks

---

<div class="post-metadata">

### Author: ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)
#### Post date: [August 21, 2024, 1:44pm UTC](https://pdfjs.community/t/invalid-pdf-structure-when-opening-file-without-pdf-extension/3415/2 "2024-08-21T13:44:14Z")

</div>

Hi there,

Unfortunately that PDF is a localhost domain so it is not accessible.

When you open the document via loadDocument API, could you please try specifying the  
extension?  
Also if it is a blob format, then it should work as expected:

> **[Open PDF.js Express from Blob | Documentation](https://pdfjs.express/documentation/basic-operations/open-document/blob)**

Best regards,  
Kevin Kim
