Skip to content

IanDarwin/pdfshow

Repository files navigation

PdfShow Version 1.0.4 (Double Header)

PdfShow is a PDF viewer specifically for running slide shows. I wrote it because I sometimes teach from PDFs and was tired of general-purpose programs like PDF Annotator and Adobe Reader, which have too many modes, controls, etc. and aren’t really optimized for showing slide decks.

Wait! Who presents from PDFs? Maybe you have to present a talk and you only have the PDF, not the ODP, KeyNote or PPT file(s). Some training companies just distribute their courses to instructors as PDFs, not presentation-software files. Or maybe you want to re-give somebody else’s preso from the PDF-only version they published online (if you do this, make sure to ask permission/give credit/respect copyrights+licenses). Or yet again, maybe you use the open-source gpresent, which doesn’t actually present shows but generates the PDF and leaves it to others to present. Or the Markdown-based MARP, which can generate PDFs directly from markdown files. Or the MagicPoint-based MagicPoint to PDF Converter. Whatever the reason you need to present with just the PDF of the slides, PdfShow is for you!

SampleShow

PdfShow has fewer features than other tools, due to its relative youth and, more importantly, its design goals. Please see the list of issues; read through it before condemning the app as incomplete and again before adding to it - anyone can create a free github account and add issues there! That is also why there’s no TODO file here - all the TODOs are in the issues list.

The program is for desktops, not mobiles. There is too much dependency on Swing to make it feasible to run on platforms other than desktop Java.

You can have multiple documents open, which show in the expected tab-vew format. You can drag the tabs around, e.g., to move the most important ones to the left (or right) or for any sort of ordering that makes sense to you at the time.

PdfShow supports dual monitors, one for control and one for viewing slides. As of now, the control window will appear on Monitor 1 and the view on Monitor 2; someday that’ll be switchable via an option.

  • You can’t draw on the miniature view (yet?), and it doesn’t show your drawings.

  • If you unplug the second monitor, you have to re-start PDFshow, but that shouldn’t be a problem.

More bells and whistles will be added as time permits, but let’s keep it relatively simple. There is still some basic functionality that is imperfect or incomplete. Pull requests will be gratefully accepted as long as they fit within the general tone of the program - minimalist, but functional.

Installing PdfShow

Table 1. Installation/Download Summary
OS Pkg Format CLI Install Install Download

Java

fat jar

n/a/

https://github.com/IanDarwin/pdfshow/releases/download/v1.0.4/pdfshow-1.0.4-jar-with-dependencies.jar

Linux

deb

Download then deb install

https://github.com/IanDarwin/pdfshow/releases/download/v1.0.4/pdfshow_1.0.4-1_amd64.deb

Linux

rpm

Download then dnf install

https://github.com/IanDarwin/pdfshow/releases/download/v1.0.4/pdfshow-1.0.4-1.x86_64.rpm

macOS

dmg

Download; should open

https://github.com/IanDarwin/pdfshow/releases/download/v1.0.4/PDFShow-1.0.4.dmg

Windows

msi

winget install RejminetGroupInc.PDFShow

https://github.com/IanDarwin/pdfshow/releases/download/v1.0.4/PDFShow-1.0.4.msi

The installers bundle their own Java VM, with which they are known to work; they are about 50Mb to download and about 120-140Mb when installed. If you already have a current Java installed, you may prefer to run the JAR file; you have to be sure you have a JDK that will work with PdfShow. The JAR is built with Java 17 on most platforms.

For MS-Windows, once you have winget installed, just type this in a terminal window:

winget install RejminetGroupInc.PDFShow

(That’s really me; Rejminet Group Inc. is my consulting company.)

If there’s no installer, and you have Java, there’s a Jar file that you can run with java -jar. You can rebuild that from source with mvn package assembly:single; see Building PdfShow From Source below.

Using PdfShow

The program is intuitive and easy to use. Of course they all say that. Just run it and use File→Open (or CTRL/CMD O), or run it with a filename argument. There’s a "recent files" menu for subsequent days of your course, for example. There is more documentation in the docs folder.

Building PdfShow From Source

Build: Prerequisites

On all platforms you need JDK (Java 17+) and Apache Maven installed. On Windows jpackage has a couple of pre-requisites, which it will let you know about if they’re not already installed.

On Linux, for RPMs, you need rpm-build or you will get told that 'rpm' is an invalid type (sudo dnf install rpm-build). On Linux, for DEBs, you may need fakeroot (sudo apt install fakeroot).

The install formats are:

Table 2. The Installer Formats
OS Default Format Other formats with mkinstaller -t

macOS

DMG, with copy-to-Applications iconage.

pkg

Linux

rpm - Redhat/Yum/dnf/Zypher

deb

Windows

MSI installer

exe

Getting Source

Download the repository from https://github.com/IanDarwin/pdfshow.

Install Apache-Maven if not already installed.

Using command-line tools:

git clone https://github.com/IanDarwin/pdfshow
cd pdfshow

Using Eclipse:

Window->Show View->Git->Git Repositories.
In the Repos window, Clone (the third icon at the right side of this window).
Enter the URL https://github.com/IanDarwin/pdfshow and click Next
On the next dialog, be sure to check Import Existing Projects before Next.
PdfShow should show up in the Package Explorer

Using IntelliJ IDEA

From the startup screen, "Get from Version Control"
Enter the URL https://github.com/IanDarwin/pdfshow and click Clone
Accept or choose the directory and click Clone
On "Open or Import" popup (with choice of how to open), select "Maven Project"

Test Runs

To test run the program in a supported Java IDE (Eclipse and IntelliJ IDEa), you just open and run Main.java. If you use another IDE, the same goes. You can even submit a pull request with that IDE’s config files, as long as it doesn’t require changing the directory structure (i.e., moving existing files around).

To run the program in Maven, use mvn exec:java.

Packaging

To make a JAR file with just the program and its images (without the dependencies), do mvn package.

To make a clickable runnable JAR file, run mvn package assembly:single. You’ll then find a jar with dependencies in the target folder. It’ll be named something like target/pdfshow-x.y.z-SNAPSHOT-jar-with-dependencies.jar. You can run it with java -jar target/pdfshow*dependencies.jar (see scripts/pdfshow), or just click on it in a file manager window in MS-Windows, macOS, or most *Nix windowed environments.

The full-blown, platform-specific installers we release are built by the mkinstaller script. This makes a clickable runnable JAR file as above and then runs the Java 14+ jpackage tool. You can run that script yourself if you want. You can only build the Mac installer on macOS, the Windows installer on Windows, etc.

Configuring a Linux rpm-based system and building PDFShow

This may not be optimal, but should work. Newer versions may be available.

sudo dnf install https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-linux.x86_64.rpm

sudo dnf install rpm-build

# These systems' packaging have Maven depending on dark ages' JDK-1.8, so:

curl -o apache-maven-3.8.4-bin.tar.gz \
	https://dlcdn.apache.org/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz

cd /usr/local; sudo tar xzvf apache-maven-3.8.4.tar.gz

PATH=$PATH:/usr/local/apache-maven-3.8.4/bin

mkdir git
cd git
git clone https://github.com/IanDarwin/pdfshow

cd pdfshow

mkinstaller -s # skiptests; they fail on this Linux with infra-related errs, don't care

Contributing / Development

Fork the repo, clone your forked copy, make changes, test changes, send a pull request.

Q: Why didn’t I use this for the drawing:

PDPageContentStream contentStream = new PDPageContentStream(document, page);
contentStream.setNonStrokingColor(Color.DARK_GRAY);
contentStream.addRect(200, 650, 100, 100);

A: The problem is that it would be much harder (if not impossible) to implement Undo processing when using that approach. Perhaps a later Save PDF function could insert the GObjects into the PDF using this technique.

Q: Why not use the built-in contains() method for hit detection?

A: The GObject hierarchy is intentionally light-weight, not JComponent, and it’s gotta be the same amount of work.

Credits

Program written by Ian Darwin of Rejminet Group Inc. Contributions by a cast of thousands (we hope); their names are listed on the main github page. Thanks folks!

PDF access (i.e., some of the heavy listing!) is done by Apache PDFBox software.

Some icons from feathericons.com; the rest by Ian Darwin.

About

Deliver/present talks from PDFs - A simple PDF presenter oriented towards slideshow decks in PDF form

Resources

License

Stars

Watchers

Forks

Packages

No packages published