I'm in need of a few features that are supported in PDF.js but require custom viewer files to work. This patch adds a config form under "Media" that allows the user to specify a path to a custom viewer.html file. If the setting is empty, the default library viewer is used.
This is really just a first attempt. It probably needs a little more help text and some sort of check to make sure the file actually exists, falling back to the default if it doesn't.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | pdf-custom-viewer-3076198-8.patch | 4.86 KB | wrd |
Comments
Comment #2
wrd commentedComment #3
wrd commentedRerolling patch against current 8.x-1.x branch.
Comment #4
wrd commentedThat patch didn't work at all. Trying again...
Comment #5
wrd commentedOK, that version (#4) is working for me, in D9 as well as D8.
Comment #6
shenzhuxi commentedI got errors with patch #4...
warning: src/Plugin/Field/FieldFormatter/PdfDefault.php has type 100755, expected 100644
error: patch failed: src/Plugin/Field/FieldFormatter/PdfDefault.php:32
error: src/Plugin/Field/FieldFormatter/PdfDefault.php: patch does not apply
Comment #7
wrd commentedProbably due to changes in the new release. I'll try to reconstruct the patch against version 1.0.
Comment #8
wrd commentedRerolled against 8.x-1.x-dev, applies to 1.0.
Comment #10
shenzhuxi commentedComment #12
thomasmurphy commentedWhat permission are required to access this config? It looks like it's "access administration pages" which seems to be far too broad.
Comment #13
mehul.shah commentedCan we do this for D7?