Error opening file

Continuing the discussion from Error while opening file on android device:

Issue Still Present in pdftron_flutter: ^1.0.1-44

We’re still encountering a persistent issue in version ^1.0.1-44 of pdftron_flutter.

Behavior:

  • The first attempt to open a document using DocumentView is successful.
  • Subsequent attempts to open the same document or any other document consistently fail.
  • The issue repeats after restarting the app: the first document opens successfully, then all further attempts fail until the app is relaunched again.

Reproduction Code:

DocumentView(
  key: UniqueKey(),
  onCreated: (controller) async {
    await controller.openDocument(_currentFileUrl!);
  },
)

Please advise if there are known workarounds or upcoming fixes

1 Like

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


You’re experiencing an issue with the pdftron_flutter plugin where only the first document opens successfully, and subsequent attempts fail until the app is restarted. This is a known issue and could be related to how the DocumentView and its controller are being managed.

Some things you can try:

  • Ensure that you are properly disposing of the DocumentView and its controller after use. This can help free up resources and avoid conflicts when opening new documents.

  • Use a unique key for each DocumentView instance to ensure that the widget tree is correctly updated and that the state is properly managed.

  • Double-check that the URLs or paths to the documents are correct and accessible each time you attempt to open them.

  • Consider using a state management solution to better handle the lifecycle of your DocumentView components.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like

Thank you for reaching out for support through our forum. In order to best assist you, would you be able to submit a video reproducing the issue you are encountering, along with a minimal runnable sample that can consistently and reliably reproduce the issue? You can submit a ticket here: Submit a ticket : Apryse

1 Like