Skip to content

Add printing style sheet, enables printing of text files#2867

Merged
vinicius73 merged 3 commits into
masterfrom
feat/print_css
Sep 13, 2022
Merged

Add printing style sheet, enables printing of text files#2867
vinicius73 merged 3 commits into
masterfrom
feat/print_css

Conversation

@susnux

@susnux susnux commented Sep 6, 2022

Copy link
Copy Markdown
Contributor

Summary

Currently printing will include the menu bar and longer text files will be cropped after the first page.
This enables printing of text documents without any major styling changes,
slightly adjusted margins and added table borders (they are quite hard to read without on paper).

This implements the CSS part of #112

@susnux susnux added enhancement New feature or request design Experience, interaction, interface, … 3. to review labels Sep 6, 2022
Comment thread css/print.scss Outdated
@susnux susnux force-pushed the feat/print_css branch 3 times, most recently from 0eddead to cd0a041 Compare September 8, 2022 12:58
@susnux

susnux commented Sep 8, 2022

Copy link
Copy Markdown
Contributor Author

I had to add the rule for hiding the content behind the modal as an event listener to prevent hiding the content if the editor was loaded for rich workspace.
So this should now work for all cases.

@vinicius73

vinicius73 commented Sep 8, 2022

Copy link
Copy Markdown
Member

Looks good @susnux

But only the "first page" is printable.

print.mp4

Is this expected?

File used into this test:

demo.md

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
Currently printing will include the menu bar and longer text files will be cropped after the first page.
This enables printing of text documents without any major styling changes,
slightly adjusted margins and added table borders.
This implements the CSS part of #112

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
@susnux

susnux commented Sep 12, 2022

Copy link
Copy Markdown
Contributor Author

@vinicius73

But only the "first page" is printable.
Is this expected?

No, this happened because the body was set to position: fixed and overflow: hidden. Added a rule to fix this.

@vinicius73 vinicius73 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome.

Peek.2022-09-12.20-36.mp4

@vinicius73

Copy link
Copy Markdown
Member

/compile

@vinicius73 vinicius73 added this to the Nextcloud 25 milestone Sep 12, 2022
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review design Experience, interaction, interface, … enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support printing notes (first print CSS, then export to PDF)

3 participants