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

[Plan B] TF-2764 Printing pdf when preview #2780

Merged
merged 8 commits into from
May 30, 2024

Conversation

dab246
Copy link
Member

@dab246 dab246 commented Apr 4, 2024

Issue

#2764

Task

  • Preview PDF file on all browser
  • Download PDF file on all browser
  • Printing PDF file on all browser (but file names are randomly generated from the respective browser)
    • Firefox: PDF.js Viewer
    • Safari: Twake Mail
    • Edge: index
    • Opera: FileName or UUID
    • Chrome: FileName or UUID
  • Show current page, total page in PDFViewer
  • Zoom in/Zoom out in PDF Viewer

Demo

Screen.Recording.2024-04-04.at.16.35.30.online-video-cutter.com.mp4

@hoangdat
Copy link
Member

hoangdat commented Apr 5, 2024

Brief about this proposal: View one-by-one PDF in Dart side in only Web app

Hi @chibenwa what do you think with this proposal (we were in progress while you sent email about revert PDF viewer). And for sure, we need to verify very carefully in all OS and browser.

Copy link

This PR has been deployed to https://linagora.github.io/tmail-flutter/2780.

@hoangdat
Copy link
Member

hoangdat commented May 7, 2024

  • the same page maybe reload many times when trying to scroll document
Screen.Recording.2024-05-07.at.16.36.16.mov

@hoangdat
Copy link
Member

hoangdat commented May 7, 2024

Chrome:

  • print big file maybe we should show popup to indicate user
  • scroll document will skip some pages: Fx: document have 3 pages, can not scroll to page 2

@hoangdat
Copy link
Member

hoangdat commented May 7, 2024

  • try to open 2 documents in the same time, document 1 will show well, but document 2 can not load
Screen.Recording.2024-05-07.at.16.51.24.mov

@dab246
Copy link
Member Author

dab246 commented May 7, 2024

  • try to open 2 documents in the same time, document 1 will show well, but document 2 can not load

Screen.Recording.2024-05-07.at.16.51.24.mov

We should only have 1 page at a time, preventing opening multiple pages at a time.

@dab246
Copy link
Member Author

dab246 commented May 7, 2024

Chrome:

  • print big file maybe we should show popup to indicate user

IMO, We just need to show the toast, which is enough for the user to understand, to avoid blocking other user actions.

@hoangdat
Copy link
Member

hoangdat commented May 7, 2024

Firefox:

  • Name of print file in Firefox wrong
image

@dab246 dab246 changed the base branch from v0.11.3-patch4-dev to master May 8, 2024 04:08
@dab246 dab246 force-pushed the maintain-v0.11.3/tf-2764-plan-b-for-printing-pdf branch from ef71a66 to 7b190a2 Compare May 8, 2024 04:22
@dab246
Copy link
Member Author

dab246 commented May 13, 2024

Chrome:

  • print big file maybe we should show popup to indicate user
  • try to open 2 documents in the same time, document 1 will show well, but document 2 can not load

Screen.Recording.2024-05-07.at.16.51.24.mov

Solution

  • Perform download attachment in PDF Viewer

Demo

Screen.Recording.2024-05-13.at.15.07.18.mov

@dab246
Copy link
Member Author

dab246 commented May 14, 2024

  • the same page maybe reload many times when trying to scroll document
  • scroll document will skip some pages: Fx: document have 3 pages, can not scroll to page 2

Solution

Demo

Screen.Recording.2024-05-14.at.16.36.42.online-video-cutter.com.mp4

@dab246 dab246 force-pushed the maintain-v0.11.3/tf-2764-plan-b-for-printing-pdf branch from bb5083e to 9ccca88 Compare May 15, 2024 03:19
@dab246
Copy link
Member Author

dab246 commented May 16, 2024

  • Memory leak
  • Disable go to page
  • Set the standard size for the page

@dab246 dab246 requested a review from hoangdat May 17, 2024 03:02
@hoangdat
Copy link
Member

hi @chibenwa please take a look on demo video, and read the ADR.

At the moment, we still have some things:

  • Print name when people try to print, PDF file is ugly. Try many ways, but can not fix (but the download work well)
    image

  • Can not jump to page. We can, but to have this we need to trade off with full screen size document.

  • Can not scroll by dragging on scroll bar in right screen. But right now, still scroll by mouse.

@hoangdat
Copy link
Member

Hi @chibenwa , hope this find you well #2780 (comment)

@chibenwa
Copy link
Member

Cool.

Proposal: Escape to exit the PDF viewer?

@chibenwa
Copy link
Member

Chromium: when printing and "save as pdf" the filename is a UUID

Direct download from the pdf viewer is OK

@chibenwa
Copy link
Member

Also on GMail when I click on the grey zone around the PDF document, it closes the document.

@hoangdat
Copy link
Member

hoangdat commented May 22, 2024

  • Download is ok
  • file name in printing is wrong in Edge, Firefox, Safari is pdf.js viewer -> Should hide this button in these browsers
  • click to outside of document or Esc keyboard -> close viewer

@dab246 dab246 force-pushed the maintain-v0.11.3/tf-2764-plan-b-for-printing-pdf branch from f03b6a3 to 4043bbc Compare May 22, 2024 09:32
@dab246
Copy link
Member Author

dab246 commented May 22, 2024

  • Download is ok
  • file name in printing is wrong in Edge, Firefox, Safari is pdf.js viewer -> Should hide this button in these browsers
  • click to outside of document or Esc keyboard -> close viewer

Done. @hoangdat Please review again.

  • Chrome browser:
Screen.Recording.2024-05-22.at.16.20.03.mov
  • Firefox browser:
firefox.mov

@dab246 dab246 requested a review from hoangdat May 22, 2024 09:34
@dab246 dab246 force-pushed the maintain-v0.11.3/tf-2764-plan-b-for-printing-pdf branch from 4043bbc to d6b9cd2 Compare May 27, 2024 02:34
@hoangdat hoangdat merged commit 652f15e into master May 30, 2024
14 checks passed
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 this pull request may close these issues.

4 participants