PDF Viewer in Java -- 3

Job ID: 30703257

Budget: €250 – €750 EUR

Using Apache PDFBox version 2.0.21 or newer, lines and text can be retrieved rather easily. There are numerous simple examples available on the web. If we extend the PDFGraphicsStreamEngine, or PDFStreamEngine, the actions are in fact only strokePath() and fillPath(int windingRule) -methods.

We need to collect paths into a list of, let us call it PathContainer, and draw them later into a canvas (simply an extended JComponent).

Our example of fillPath is as follows in the attached file.


etc. Now, the path containers have all necessary information about lines, line width, color, tiling pattern, shading, and whatever it contains.

And later we paint it (in JComponent)
for (int i = 0; i < pathContainerList.size(); i++) {
Object o = pathContainerList.get(i);
draw ... with color and optionally tiling pattern
paint the rest.

The needs are as
- collect all lines and text into lists that can be drawn later
- ability to store the objects (serialize/deserialize) onto disk (because computer memory runs out if pdf-files are large)
- ability to separate possible layers in the original pdf

Note 1: some of our pdf-files can contain up to 130 000 lines plus the text.
Note 2: we have a working solution but it is not complete yet. See attached files.