Cannot preview document on iOS
Problem reported by Varian - 8/25/2025 at 12:05 AM
Resolved
The document cannot be loaded. nly the toolbar appears, and no document is loaded. The error log is PROMISE_REJECTED: Error: The `container` must be absolutely positioned.

We're using iOS 18.5 and Gleamtech Document Ultimate 7.5.9.0.

Cem Alacayir Replied
Employee Post
Ok this should now be fixed:

Version 7.7.0 - August 26, 2025

  • Fixed: Avoid The `container` must be absolutely positioned. error in revisited Viewer pages on iOS Safari.

Varian Replied
Hi Cem, 

We still got the same error after updated to version 7.7.0
Cem Alacayir Replied
Employee Post
Cannot replicate the error. Update to the latest version, 7.7.0 is now old.
If you still get the error, I need to see your code. For example are you doing anything in client-side events? Are you manipulating viewer's iframe in any way? This iframe is normally isolated but maybe you change dom from outside?
Varian Replied
We tried on the mobile Safari browser. This issue is intermittent — we tested it 20 times, and it failed to preview twice to three times. We also have a video showing one of the three failed attempts to preview the PDF. We don't manipulating viewer's iframe in anywhere  and no change dom from outside.

Here is our setting on dotnet:
 var documentViewer = new DocumentViewer()
 {
     Width = CssLength.Percentage(100),
     Height = CssLength.Pixel(Request.Browser.ScreenPixelsHeight * 2),
     Document = new StreamFileProvider(fileStream.FileName, fileStream.FileStream, DateTime.Now, fileStream.FileStream.Length),
     DocumentOptions = documentOptions,
     ToolbarVisible = pToolbarVisible,
     SidebarVisible = pToolbarVisible,
     SidebarView = DocumentViewerSidebarView.Thumbs,
     RememberViewHistory = false,
     VerticalToolbarVisible = false,
 };

here is our html code
@using GleamTech.AspNet.Mvc
@using GleamTech.DocumentUltimate.AspNet.UI
@using GleamTech.AspNet.UI;

@model DocumentViewer

<script>
</script>

<!DOCTYPE html>

@{
    DocumentViewer documentViewer = Model;
    documentViewer.Height = CssLength.Percentage(100);
}

<html>
<head>
    @this.RenderHead(documentViewer)
</head>
<body>
    @this.RenderBody(documentViewer)
</body>
</html>

Cem Alacayir Replied
Employee Post
Did you test also with latest v7.7.6 (we expecially have some viewer rendering updates in v7.7.1 and v7.7.2) ?

If still error, try putting something in your HTML page, that changes (even if doc is the same), thus busts page caching:

<!-- @DateTime.Now -->
Cem Alacayir Replied
Employee Post
Ok, we have a new release which I think will fix your issue, Version 7.8.0 - October 20, 2025:
  • Fixed: When creating multiple instances of viewer in the same page
    webviewerloaded event was being registered multiple times thus causing errors.
    This may be the root cause of unreplicated error: The `container` must be absolutely positioned..
    The viewer id was being unnecessarily incremented even if it did not exist in the document.
    Track viewer id internally as user may re-assign the window global variable.

Varian Replied
We tested version 7.8.0, but the issue persists. The test failed, producing a new "File not found" error and a blank document preview.
 
imageimage
Cem Alacayir Replied
Employee Post
"File not found" error is not from DocumentViewer. Check your file loading code.
For example, where does fileStream come from in this code? Probably your stream is being disposed before reaching there:
 var documentViewer = new DocumentViewer()
 {

     Document = new StreamFileProvider(fileStream.FileName, fileStream.FileStream, DateTime.Now, fileStream.FileStream.Length),
   
 };
Varian Replied

Yes, the "File not found" error is indeed being generated by our application.

We verified the code and confirmed that the file stream is not being prematurely disposed.

Upon enabling DebugMode = true, we captured this specific error. 

imageimage

We have also checked the IIS logs, which may contain relevant information for further troubleshooting.

This is the relevant IIS log entry captured when the error occurred.

image

 

This is the IIS log from a time when no error occurred.

image

 

Replication Steps:

Using an iOS device, repeatedly open and close a document until the error is encountered. (e.g., Open, Close, Open, Close, Open, Error.)

Cem Alacayir Replied
Employee Post Marked As Resolution
This problem is hard to replicate for example it can't be replicated on iOS Simulator. I suspect it may be related to bfcache (back-forward cache) issues on iOS Safari (and other iOS browsers) and apps using WebView. bfcache is disabled in iOS Simulator so that may explain why it can't be replicated there. We have a new release to handle bfcache issue so please test this version and let me know if it solves the problem:

Version 7.8.7 - December 23, 2025

  • Fixed: Attempt to fix bfcache (back-forward cache) issues on iOS Safari (and others) and apps using WebView.
    Reload iframe (recreate iframe) to prevent possible issues when restoring from bfcache.

  • Fixed: Loading bar position was not accurate on mobile mode (was shown in the middle of the toolbar)
    or when toolbarAtBottom option was used.

  • Improved: When DebugMode property set to true, do not display alert dialog
    for "same and repeating" global unhandled errors and unhandled promise rejections in browser window.
    For example "ResizeObserver loop..." errors can spam the alert dialog and make page unusable, so
    display error only if it's changed.

Reply to Thread

Enter the verification text