PDFjs Viewer Mod
Downloads of PDFjs Viewer Mod are restricted to logged in users. If you do not have a user account on the TNG Wiki use the Request Account link to request a user account | ||
If you have trouble downloading with Google Chrome, Vivaldi, Brave or other Chromium based browser, try using a right-click and select Open in new Window, then F5, or use another browser such as Firefox
|
PDFjs Viewer Mod | |||
---|---|---|---|
Summary | Change the PDF viewer from the default to PDFjs | ||
Validation | |||
Mod Updated | 02 Jan 2022 | ||
Download link | PDFjs Viewer Mod v13.1.1.2
| ||
Download stats | See download statistics | ||
Author(s) | Martin Pannier Brent Hemphill | ||
Homepage | PDFjs Viewer Mod (This page) | ||
Mod Support | TNG Community Forums | ||
Contact Developer | |||
Latest Mod | 13.1.1.2 | ||
Min TNG V | 13.0.0 | ||
Max TNG V | 13.1.1 | ||
Files modified | showmedialib.php | ||
Related Mods | |||
Notes | Requires the pdfjs folder to be placed in the TNG root folder. |
Purpose of the mod
This TNG modification changes the default PDF viewer from the browser default to PDFjs. The push to change the default viewer was driven by the need to be able to view multiple pages, or scroll down a page in Android and iOS phone and tablet devices.
- This change allows mobile and tablet devices to view PDF files in a viewer that uses page viewing and other PDF options that are not necessarily available with the default browser option.
- This change also allows for some customization of button options for those administrators wishing to control the PDF viewing options with the customization listed below.
Developer
The PDF Viewer Mod was originally developed by Martin Pannier.
The PDFjs Viewer Mod was created from the original PDF Viewer Mod to work in TNG 13 with a newer version of PDFjs by Brent Hemphill.
Jim Brown did beta testing to check the functionality under additional setup configurations.
Dutch language strings by Rob Severijns.
Revision History
Version | Date | Contents |
---|---|---|
13.1.1.2 | 02 Jan 2022 | Update for TNG 13.1.1 compatibility. Dutch language strings by Rob Severijns. |
13.0.0.1 | 16 Sept 2021 | Fix issues when the path to the media is in the root or other unexpected paths. Add an option to allow for enabling the viewer all the time or only when in mobile mode. |
13.0.0.0 | 26 May 2021 | initial release |
Requirements
- A working TNG installation.
- A backup of your TNG showmedialib.php file.
Automated Installation
- Download the appropriate mod configuration package as identified in the upper right status box.
- Extract and copy the cfg file in the zip to your mods folder.
- ***Extract and copy the pdfjs folder to your TNG root folder.***
- Follow the normal automated installation for Mod Manager mods, as shown in the example Mod Manager - Installing Config Files.
Side effects
- As with most source code modifications, these changes will likely be overwritten during your next TNG revision upgrade and will need to be re-implemented. (Using the Mod Manager greatly simplifies this process).
cust_text.php
The following custom text entries need to be created in your language, if you do not use English for TNG Admin
$admtext['pdfjs_viewer'] = "Enable pdfjs Viewer";
$admtext['mobile_only'] = "Mobile only";
Customizations
Under Administration >> Setup >> Configuration >> General Settings >> Media >> Enable pdfjs viewer there is the option to enable PDFjs as the viewer only for mobile mode, or always.
Although the default buttons in the viewer generally work well, some buttons may be customized to be hidden
- Open
- Download
- Bookmark
The above buttons may be changed by using PDFjs Viewer Mod Hide Buttons v13.0.0.1 and removing any buttons from the cfg that you do not wish to be hidden from the user. You only need this mod if you want to hide some of the default viewer buttons listed above.
In the event of a problem with your TNG site
- Try using the Mod Manager Remove capability
- copy your backup showmedialib.php file to your base TNG directory
- all should be well now
Sites using this mod
Please add your TNG site to the list if you utilize this modification!
URL | User | Note | Mod-Version | TNG-Version | User-language |
---|---|---|---|---|---|
Brent Hemphill | Private Site/localhost | 13.1.1.2 | 13.1.1 | EN | |
The Brown Family | James Brown | Beta tester | 13.0.0.0 | 13.0.3 | EN |
Genealogy of a Dutch East-Indies Family | Rob Severijns | Private | 13.0.0.1 | 13.1 | NL/EN |