A lightweight PHP-based viewer for digitized and born-digital newspaper issues in PDF format, rendered using PDF.js. The viewer uses an id URL parameter to locate and display specific newspaper issues along with their metadata.
The viewer uses a URL parameter id with the following format:
ttt: Newspaper title code (3 lowercase letters, a–z)YYYY: Year (4 digits)MM: Month (2 digits)DD: Day (2 digits)CC: Copy number (2 digits)
Examples:
→ Adair County News, May 18, 1923, Copy 01 (ada1923051801)
→ SAMPLE PHP Viewer URL: https://kdnp.uky.edu/?id=afr1900060101
→ SAMPLE PDF.js URL: https://kdnp.uky.edu/vwp.html?file=pv/afr/afr1900060101/page_1.pdf
The system separates metadata and PDF content into two top-level directories:
meta/: Contains XML metadata filespv/: Contains PDF files- Subdirectory structure is based on:
- Title code (
ttt) - Full issue ID (
tttYYYYMMDDCC) - meta/ttt/tttYYYYMMDDCC.xml
- pv/ttt/tttYYYYMMDDCC/tttYYYYMMDDCC.pdf
- Title code (
index.phpreads theidparameter from the URL- Extracts:
- Title code (first 3 letters)
- Full issue ID
- Constructs paths:
- PDF:
pv/ttt/tttYYYYMMDDCC/tttYYYYMMDDCC.pdf - Metadata:
meta/ttt/tttYYYYMMDDCC.xml
- PDF:
- Loads:
- PDF via PDF.js
- Metadata XML
- Displays:
- PDF pages
- Metadata (title, date, etc.)
- Viewer features powered by metadata
- Features:
- Page searching
- Search hit highlighting
- Page navigation/turning
- Page section selection and clipping tool
- Display title histories
- PDF.js: Client-side PDF rendering
- html-to-image: Client-side Generate an image from a DOM node
- PHP: For backend routing and file access
- XML: Metadata format per issue
- Requires valid
idformat in requests - Metadata schema must be consistent across issues
- Designed for minimalism and performance
This software on this site is provided "as-is," without any express or implied warranty. In no event shall libmanuk be held liable for any damages arising from the use of the software.