Skip to content

Open PDF from URL Fails or Does Not Open

This guide troubleshoots issues when opening PDFs with openDocFromUrl(String url, byte[] password, CacheOption cacheOption, HttpRequestProperties properties), including incomplete display or failure to display.

Common Causes

  • Incomplete cache: If the document has many objects and is closed before loading finishes, caching may not complete.
  • Hard to validate cache: On reload, you can usually tell whether something was cached, but not whether the cached content is complete and usable.

Suggested Fix: Clear Cache and Reopen

Clear cache for a specific URL or clear all cache, then reopen:

java
// Clear cache for a specific URL
public void clearCacheFile(String url) {
    docManager.clearUrlCache(url);
}

// Clear all cached files
public void clearAllCacheFiles() {
    docManager.clearUrlCache(null);
}