Skip to content

Commit 5ffebe4

Browse files
authored
Update documentation (#249)
* update documentation and dependencies page * Add study on thesis extraction (up to 1Gb PDF files) --------- Signed-off-by: Luca Foppiano <luca@foppiano.org>
1 parent 4e08e1a commit 5ffebe4

3 files changed

Lines changed: 434 additions & 12 deletions

File tree

Dependencies_INSTALL.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# External Libraries
22

3-
Here we describe procedures to compile the static dependencies.
3+
> **You do not need this to build pdfalto.** The static libraries and their headers are committed under `libs/` for
4+
> every supported platform, so a normal build just works — see [Build](Readme.md#build). This document describes how
5+
> those libraries are produced, and is only relevant when updating a dependency version or porting to a new platform.
46
5-
The include and the libraries are shipped under `libs`, you can also find the artifact in the bottom of the page of
6-
each [build](https://github.com/kermitt2/pdfalto/actions) under [Manual build static libraries](https://github.com/kermitt2/pdfalto/actions/workflows/ci-build-libs.yml).
7+
Normally the libraries are built by the
8+
[`ci-build-libs.yml`](https://github.com/kermitt2/pdfalto/blob/master/.github/workflows/ci-build-libs.yml) workflow
9+
("Manual build static libraries"), which runs the procedures below across a matrix of Linux and macOS runners and
10+
publishes the results as artifacts at the bottom of each [run](https://github.com/kermitt2/pdfalto/actions). Updating
11+
a dependency means bumping its version variable at the top of that workflow, running it, and committing the resulting
12+
artifacts into `libs/` — the versions listed below should be kept in sync with it.
13+
14+
The manual steps that follow are the fallback for a platform CI does not cover, or for debugging a dependency
15+
locally. `./install_deps.sh` automates the same procedures.
716

817
## Requirements
918

@@ -13,6 +22,8 @@ each [build](https://github.com/kermitt2/pdfalto/actions) under [Manual build st
1322

1423
## Current versions:
1524

25+
(these mirror the version variables at the top of `ci-build-libs.yml`)
26+
1627
- LibPNG: 1.6.56
1728
- zLib: 1.3.2
1829
- libxml2: 2.15.2
@@ -125,7 +136,7 @@ LibPNG and zLib sources are downloaded and built as part of the dependency build
125136
make install
126137
```
127138

128-
See [ICU Readme](http://source.icu-project.org/repos/icu/trunk/icu4c/readme.html) for futher details.
139+
See the [ICU4C build guide](https://unicode-org.github.io/icu/userguide/icu4c/build.html) for further details.
129140

130141
7. Copy `output/lib/libicuuc.a` and `output/lib/libicudata.a` under `libs/icu/<OS>/<ARCH>/` and headers from `output/include/` under `libs/icu/include/`.
131142

Readme.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ end-user.
2626
* compilers : clang > 5 or gcc > 7, c++17 required
2727
* makefile generator : cmake >= 3.10.0
2828
* fetching dependencies : wget
29+
* git : the Xpdf source is a git submodule, so the repository must be cloned (not downloaded as a zip) and the
30+
submodule initialised with `git submodule update --init --recursive` — see [Build](#build)
2931

3032
## Usage
3133

@@ -127,19 +129,25 @@ line, the following outputs the text content only:
127129
128130
## Dependencies
129131

130-
Dependencies can be recompiled by running this [script](https://github.com/kermitt2/pdfalto/blob/master/install_deps.sh)
132+
**Nothing to do here for a normal build.** The static libraries pdfalto links against (libxml2, freetype, libpng,
133+
zlib, ICU) are committed to this repository under `libs/`, prebuilt for each supported platform (`linux/64`,
134+
`linux/arm64`, `mac/64`, `mac/arm64`, and windows). The xpdf language support packages are likewise committed under
135+
`languages/`. Cloning the repository is enough — go straight to [Build](#build).
131136

132-
> ./install_deps.sh
137+
These libraries are produced by the
138+
[`ci-build-libs.yml`](https://github.com/kermitt2/pdfalto/blob/master/.github/workflows/ci-build-libs.yml) workflow,
139+
which builds every platform in a matrix and is run manually (`workflow_dispatch`) when a dependency needs updating.
140+
The library versions it pins are declared at the top of that file. Rebuilding them is a maintainer task, not a
141+
prerequisite for building pdfalto.
133142

134-
The script will download and build the dependencies unders `libs/` and the additional language support packages for xpdf
135-
under `languages/`.
136-
137-
If necessary, see [compiling dependencies procedures](Dependencies_INSTALL.md) for further details.
143+
If you do need to rebuild them locally — porting to a new platform, or bisecting a dependency — `./install_deps.sh`
144+
downloads and builds them into `libs/` and `languages/`; see
145+
[compiling dependencies procedures](Dependencies_INSTALL.md) for details.
138146

139147
### Known issues
140148

141149
([issue 41](https://github.com/kermitt2/pdfalto/issues/41)) might occur while building, in this case you'll need to
142-
compile the dependencies before building pdflato.
150+
compile the dependencies before building pdfalto.
143151

144152
## Build
145153

@@ -187,7 +195,9 @@ building, see described workaround.
187195

188196
- map special characters in secondary fonts to their expected unicode
189197

190-
- try to optimize speed and memory
198+
- reduce the memory still retained per page in the text extraction path: peak memory no longer grows with the number
199+
of pages, but some per-page allocations are released later than they could be, so very long documents (tens of
200+
thousands of pages) still hold more than they need to
191201

192202
- see the issue tracker for further tasks
193203

0 commit comments

Comments
 (0)