Backport pdf closebutton

Backport @bastho's changes.
Fixes owncloud/core#2356

@DeepDiver1975 @jancborchardt @XueSheng-GIT @cyberdaemon