-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
60 lines (40 loc) · 1.8 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
unscroll
========
unscroll is a program to take a pdf file which is the "wrong shape"
and output one that's a more useful shape to print with.
This was inspired by the files you create with some interactive
whiteboard software, which are laid out on "a4" pages as follows.
/--------------\
| |
| |
| ##### |
| ##### |
| ##### |
| ##### |
| ##### |
| ##### |
| ##### |
\--------------/
This is useless for printing since everything's tiny and there's miles
of whitespace everywhere. Fortunately, there are gaps in the black
stuff, since it's actually lines of text.
unscroll searches for rectangular hunks of non-white and uses a simple
word-wrap algorithm to distribute them among more pages, hopefully
ending up with much better use of the available space.
After building the program, the simplest command line is something like
./src/unscroll data/squiggle.pdf out.pdf
This renders squiggle.pdf at 150 dpi and rejigs everything to fit
nicely on your system's standard paper size (probably configured at
/etc/papersize). It then renders the hunks with a jpeg quality setting
of 75%.
To change the defaults, you can use a command like
./src/unscroll -d 200 -Q 30 -s a5 data/squiggle.pdf out.pdf
for 200 dpi, 30% quality and A5 paper.
TODO:
- Implement a "justification" algorithm to spread out hunks on the
page more evenly.
- Deal with off-white data better e.g. scanned images. This will
require the is_white stuff in page.c to be changed.
- Automatically guess the correct dpi? Is this even possible?
- Vary dpi between pages. This would work well if it was automatically
determined. Could be messy as command line arguments.