Skip to content

Display download button for large PDFs

Jacques Erasmus requested to merge 324339-large-pdf-button into master

What does this MR do and why?

This MR adds the ability to display a Download button when a PDF is too large to be displayed by the blob viewer.

With changes in this MR a PDF that is larger than 10 MB OR more than 50 pages will not be rendered, instead a download button will be displayed.

Screenshots or screen recordings

file screenshot
1 page (46.18 KiB) Screenshot_2021-12-06_at_11.18.59
12 pages (10+ MB) Screenshot_2021-12-06_at_11.19.23
126 pages (5 MB) Screenshot_2021-12-06_at_11.19.43

How to set up and validate locally

  1. Enable the blob refactor
    Feature.enable(:refactor_blob_viewer)
  2. View a large PDF
  3. Notice the Download button

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #324339 (closed)

Edited by Jacques Erasmus

Merge request reports

Loading