https://github.com/janpstrunn/pdfviewer-sh
⚡️ Simple script to simplify the process to read PDF in the CLI
https://github.com/janpstrunn/pdfviewer-sh
pdf-viewer script terminal
Last synced: 2 months ago
JSON representation
⚡️ Simple script to simplify the process to read PDF in the CLI
- Host: GitHub
- URL: https://github.com/janpstrunn/pdfviewer-sh
- Owner: janpstrunn
- License: mit
- Created: 2025-01-13T00:23:28.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-03-07T16:53:51.000Z (3 months ago)
- Last Synced: 2025-03-07T17:34:52.970Z (3 months ago)
- Topics: pdf-viewer, script, terminal
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PDF Viewer
`pdfviewer.sh` is a simple shell script to simply the process to read PDF in the Terminal.
It uses mutool under the hood to convert PDF files to text or HTML files, that can be read by any viewer of choice.
## Requirements
- mutool
- Any viewer of choice### Optional
- RHVoice
- lynx or w3m
- fzf (for searching the cache folder)## Features
- Convert PDF files to text or HTML files and save to cache folder
- Hear PDF using RHVoice TTS
- Search cache folder using fzf
- Expand lines, if they don't fit the whole screen## Usage
The first time you use `pdfviewer.sh` the cache folder will be created at `$HOME/.cache/pdfviewer` by default, where all processed files will live, allowing easier access skipping the convert process.
```
CLI PDF Viewer
Usage: $0 [option] path/to/pdf
Available options:
-e, --expand [-p] - Expand text, if text format is used
-f, --fzf - Fuzzy finder parsed files
-h, --help - Displays this message and exits
-hl, --html - Create HTML file instead of text
-p, --pager [arg] - Use alternative pager
-v, --voice [profile] - Use RHVoice as TTS
```**Examples:**
1. `pdfviewer.sh -w -p bat pdfile.pdf` To expand lines and use bat as the viewer
2. `pdfviewer.sh -f` To use fzf to search the cache folder and view files
3. `pdfviewer.sh -hl pdfile.pdf` To create a HTML file**Important:**
- `-w` option requires `-p` option to be used
## Installation
Make sure to add the script to your `$PATH` for convenience.
```
git clone https://github.com/janpstrunn/pdfviewer
cd eureka-sh
chmod +x pdfviewer.sh
```Tip: Set an alias for `pdfviewer`
## Notes
This script has been only tested in a Linux Machine.