# Issue Blazor Hybrid (Android) 'There is no content at lib/ui/index.html#...'

**URL:** https://pdfjs.community/t/issue-blazor-hybrid-android-there-is-no-content-at-lib-ui-index-html/3701
**Category:** Technical Support
**Tags:** pdfjs-express
**Created:** [May 15, 2025, 9:11am UTC](https://pdfjs.community/t/issue-blazor-hybrid-android-there-is-no-content-at-lib-ui-index-html/3701 "2025-05-15T09:11:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aw.zijderveld1](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@aw.zijderveld1](https://pdfjs.community/u/aw.zijderveld1)
#### Post date: [May 15, 2025, 9:11am UTC](https://pdfjs.community/t/issue-blazor-hybrid-android-there-is-no-content-at-lib-ui-index-html/3701/1 "2025-05-15T09:11:51Z")

</div>

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

**PDF.js Express Version**  
8.7.5

**Detailed description of issue**  
I’m currently working on a .NET 9 Blazor Hybrid + Web App project where I use the PDF.js Express Viewer for opening PDF-files. For implementing the PDF-viewer in my project I used the documentation [Integrating PDF.js Express Viewer into an existing Blazor project](https://pdfjs.express/documentation/get-started-viewer/blazor/exist-project) which worked great. And it now works on the Web and Windows App, without any problems.

However in my Android App I get an error message (404), see picture below, when I want to use the PDF-viewer. And when I open my browser devtools I get the same error message as on the screen, without any extra information.

Note: All the apps use the same Blazor code, by using a Razor Class Library (RCL). So the same Blazor, C#, CSS and JavaScript code is used for web, Windows and Android.

 ![Error on screen Android app](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/5/5c3df2869390e182b371f0048d57a73457c3b429.png)

**Expected behaviour**  
The expected behavior is that the PDF-viewer is opened and displaying a file, the initial file is good enough to begin with.

**Does your issue happen with every document, or just one?**  
It only happens on Android, but with every document. Even when you don’t add a initialDoc.

**Link to document**  
The initialDoc is the file from the documentation: [https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf](https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf).

**Code snippet**  
Home.razor

```javascript
<div id="viewer" style="width: 90vw; height: 75vh; margin: 0 auto;"></div>

```

Home.razor.cs

```javascript
public partial class Home : IAsyncDisposable
{
    [Inject]
    public IJSRuntime JS { get; set; }

    private string _pdfBase64String = string.Empty;

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (!firstRender) { return; }

        var fileName = "GAC_RG_TEKE_01.pdf";
        var searchValue = "tlTAtri_PT-001";
        _pdfBase64String = ""; // Filled by API

        await JS.InvokeAsync<object>("webviewerFunctions.initWebViewer", _pdfBase64String, searchValue, fileName);
    }
}

```

js/webviewerScript.js

```javascript
window.webviewerFunctions = {
    initWebViewer: (pdfBase64String, searchValue, fileName) => {
        const viewerElement = document.getElementById('viewer');

        function base64ToBlob(base64) {
            const binaryString = window.atob(base64);
            const len = binaryString.length;
            const bytes = new Uint8Array(len);
            for (let i = 0; i < len; ++i) {
                bytes[i] = binaryString.charCodeAt(i);
            }

            return new Blob([bytes], { type: 'application/pdf' });
        };

        WebViewer({
            path: 'lib',
            licenseKey: '...',
            initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf'
        }, viewerElement).then(instance => {
            instance.UI.loadDocument(base64ToBlob(pdfBase64String), { filename: fileName });

            // adding an event listener for when a document is loaded
            const { documentViewer } = instance.Core;
            documentViewer.addEventListener('documentLoaded', () => {
                instance.UI.searchTextFull(searchValue);
            });
        })
    }
};

```

---

<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: [May 15, 2025, 4:21pm UTC](https://pdfjs.community/t/issue-blazor-hybrid-android-there-is-no-content-at-lib-ui-index-html/3701/3 "2025-05-15T16:21:05Z")

</div>

Hi there,

Are there any error messages in the console or failed requests in the network panel of the developer tools?

It may also be that the blazor application does not serve files (the url of the document) the same way as a web server.  
‘lib/ui/index.html’ path is relative and assumes a web context, which doesn’t exist in a native mobile app.

Best regards,  
Kevin

---

<div class="post-metadata">

### Author: ![aw.zijderveld1](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@aw.zijderveld1](https://pdfjs.community/u/aw.zijderveld1)
#### Post date: [May 16, 2025, 6:51am UTC](https://pdfjs.community/t/issue-blazor-hybrid-android-there-is-no-content-at-lib-ui-index-html/3701/4 "2025-05-16T06:51:14Z")

</div>

Hi @kkim,

Thanks a lot for your fast response.

I get the following error message in the console and failed request in the network panel:

 ![Error logs](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/0/08faae1eaf6d8394d3a3f588fa32e96a287edb9f.png)

Also, when I go manually to ‘./lib/ui/home.html’ by using a href, then I see the empty pdf-viewer and one console error message:

```javascript
<a href="./lib/ui/index.html">Test Webviewer</a>

```

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

Best regards,  
Adwin

---

<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: [May 16, 2025, 5:45pm UTC](https://pdfjs.community/t/issue-blazor-hybrid-android-there-is-no-content-at-lib-ui-index-html/3701/5 "2025-05-16T17:45:51Z")

</div>

Hi there,

It looks like your Android blazor application cannot find the .html file due to the potential pathing changes in a blazor application.  
I found a stackoverflow post with a similar issue here:  
[https://stackoverflow.com/questions/75483131/link-to-html-page-not-working-in-live-server-blazor-wasm-app-but-is-working-loca](https://stackoverflow.com/questions/75483131/link-to-html-page-not-working-in-live-server-blazor-wasm-app-but-is-working-loca)

Best regards,  
Kevin
