Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PdfViewer.uri is broken on web for non relative paths #37

Closed
jezell opened this issue Jan 19, 2024 · 1 comment · Fixed by #38
Closed

PdfViewer.uri is broken on web for non relative paths #37

jezell opened this issue Jan 19, 2024 · 1 comment · Fixed by #38

Comments

@jezell
Copy link

jezell commented Jan 19, 2024

PdfViewer.uri doesn't work with absolute URLs because it throws out everything but the path:

 @override
  Future<PdfDocument> openUri(
    Uri uri, {
    String? password,
    PdfPasswordProvider? passwordProvider,
    PdfDownloadProgressCallback? progressCallback,
  }) =>
      openFile(
        uri.path,
        password: password,
        passwordProvider: passwordProvider,
      );

  static bool _isPasswordError(dynamic e) =>
      e.toString().startsWith('PasswordException:');
}

if your URI requires the host / scheme, etc. you can't view the document. We were loading PDFs with pdf_render via remote URLs before, but those don't work with Pdfrx because of this.

Because of #36 we can't manually load the pdfs and pass them to the viewer with http.get either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants