
Whitening PDF Documents with Java
=================================

From the website:

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th
  http://fivedots.coe.psu.ac.th/~ad/whiten


If you use this code, please mention my name, and 
include a link to the website.

Thanks,
  Andrew

===================================================
Contents

Code:
* GetPage.java    
* WhitenPage.java
* WhitenDoc.java

Batch files:
  * compile.bat
  * run.bat

----------------------------
Compiling:

> compile *.java
    -- make sure you've installed 
       the /libs directory (which is available 
       as a separate download from the website)

    -- you need to have Java installed (v.11 or later)

----------------------------
Example (for details, see the webpage):

Stage 1.
> run GetPage elements20.pdf 17
    -- the image is saved to elements20-17.png
    -- elements20.pdf can be downloaded from the website

Stage 2.
Load the image into the ImageJ application. A copy
is available on the website in ij153.zip or from
https://imagej.nih.gov/ij/ImageJ

Stage 3. 
> run WhitenPage elements20.pdf 17 19 137
    -- the whitened page is saved to elements20-W17.pdf

Stage 4.
> run WhitenDoc elements20.pdf 19 137
    -- the whitened doc is saved to elements20-WAll.pdf

------------------------------
libs/ Contents

libs/ contains 4 JAR files:
* pdfbox-app-2.0.27.jar
* jai-imageio-core-1.4.0.jar
* jai-imageio-jpeg2000-1.4.0.jar
* ij.jar

The first three are for Apache PDFBox
https://pdfbox.apache.org/ 
and the last is for ImageJ 
https://imagej.nih.gov/ij/ImageJ


-----------------------------
Last updated: 18th October 2022
