-
-
Notifications
You must be signed in to change notification settings - Fork 185
Description
When a document is closed via closeDocument() and then re-opened with openDocumentUrl() using the same documentId, the document appears blank — scrollable space is present (as if pages exist) but nothing is rendered.
Steps to reproduce:
- Open a document with a given ID (e.g. "doc-1")
- Close it with docManager.closeDocument("doc-1")
- Wait for DocumentClosed event
- Re-open with docManager.openDocumentUrl({ url: "...", documentId: "doc-1" })
Expected: Document opens and renders normally, same as the first time.
Actual: OpenDocumentBuffer succeeds, DocumentOpened fires, but pages render blank. The scroll area reflects the correct page count/dimensions but no page content is painted.
Environment:
@embedpdf/*: 2.4.1
Browser: Chrome (latest)
Notes:
Waiting an arbitrary amount of time (15+ seconds) between close and re-open does not help — this is not a timing/race condition.
The first open with the same ID always works. Only subsequent opens after a close are affected.
Using a different documentId for the re-open works around the issue.