box / box/box-content-preview

Printing to Save as PDF Does Not Use Actual Filename

Open
#1,248 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
120
Forks
137
Avg merge
12h 36m
Merged PRs (30d)
17

Description

**Environment:**
- Preview version: all versions including v2.50.0

**Desktop (please complete the following information):**
- OS: all OS versions
- Browser: all browsers
- Version: all browser versions

**Steps to reproduce the problem:**
1. Load any file in previewer component
2. Click the print button and attempt to save as PDF
3. Notice the filename is the browser attempts to save as is not the name of the actual file

**What is the expected behavior? (Screenshots can be helpful here)**
The default filename that the browser should try to save as should be the actual filename

**What went wrong? (Screenshots, console logs, or HAR files can be helpful here)**

Sample screenshot trying to print a pdf and telling the browser to save it as a pdf:
![Screen Shot 2020-09-04 at 8 13 40 AM](https://user-images.githubusercontent.com/6386688/92243129-928d8d00-ee86-11ea-97d9-4898f8d13578.png)

Different viewers print differently but they all have the same problem (ie [document viewer](https://github.com/box/box-content-preview/blob/6ab482eb0a55f3ee967ae730f706dd26618671fe/src/lib/viewers/doc/DocBaseViewer.js#L952) print logic).

Contributor guide

Open the contributing guide

Research direction

Start with the print logic in src/lib/viewers/doc/DocBaseViewer.js, then compare it with the corresponding print paths for the other viewers mentioned in the issue. Reproduce saving a preview as PDF across a browser and viewer, and verify that the browser's suggested filename matches the actual file name.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.