Skip to content

A simple PDF viewer oriented towards slideshow decks in PDF form

License

Notifications You must be signed in to change notification settings

xinyang-jin/pdfshow

 
 

Repository files navigation

PdfShow

Some training companies just distribute their courses as PDFs, not presentation-software files. For whatever reason you need to present with just have the PDF of the slides, not the ODP, Keynote or PPT files, PdfShow is for you! PdfShow is a PDF viewer specifically for running slide shows. I wrote it (using Java Swing) because I do 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.

SampleShow

PdfShow has limitations compared with other tools (see the TODO list), due to its relative youth and, more importantly, its design goals.

more bells and whistles will be added as time permits, but let’s keep it relatively simple.

Pull requests will be gratefully accepted as long as they fit within the general tone of the program - minimalist, but functional.

Installing PdfShow

There may be an installer for your computing platform; see https://github.com/IanDarwin/pdfshow/releases. Check the latest release under the Assets dropdown.

Note that these 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 use the source or JAR approach, you have to be sure you have a JDK that will work with PdfShow.

If there’s no installer, or you’d rather build from source, see Build 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.

Build PdfShow From Source

Getting Source

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"

Prerequisites

You need to have Java 11+ and Maven installed. You need Java 14+ if you want to build any of the full platform-specific installers.

Test Runs

To test run the program in Eclipse or IntelliJ IDEA, you can just open and run PdfShow.java, the main-program file. If you use another IDE, you can import and run it. 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 integration-test. I chose that since Maven doesn’t offer a "run" phase, and I didn’t want to pollute the "test" phase with interactivity.

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 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, which makes a clickable runnable JAR file and then runs the Java 14+ jpackage tool. You can run that script yourself if you want. Note that on Windows jpackage has a couple of pre-requisites, which it will let you know about if they’re not already installed.

The install formats are:

Table 1. 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

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).

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

A simple PDF viewer oriented towards slideshow decks in PDF form

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 97.0%
  • Shell 3.0%