Skip to content

Commit dfd5af9

Browse files
author
casties
committed
updated documentation style and new docs for PDF generator.
1 parent b89c3c9 commit dfd5af9

File tree

6 files changed

+92
-6
lines changed

6 files changed

+92
-6
lines changed

doc/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
<plugin>
1616
<groupId>org.apache.maven.plugins</groupId>
1717
<artifactId>maven-site-plugin</artifactId>
18-
<version>3.8.2</version>
18+
<version>3.9.1</version>
1919
<configuration>
2020
<saveProcessedContent>true</saveProcessedContent>
2121
</configuration>
2222
<dependencies>
2323
<dependency>
2424
<groupId>org.apache.maven.doxia</groupId>
2525
<artifactId>doxia-module-markdown</artifactId>
26-
<version>1.9</version>
26+
<version>1.9.1</version>
2727
</dependency>
2828
</dependencies>
2929
</plugin>

doc/src/site/markdown/build-maven.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ to add `-Pservlet3` or `-Pservlet2` as well.
146146

147147
### pdf
148148

149-
`-Ppdf` builds digilib with the "PDFCache" servlet to generate and download PDF files from images.
150-
(see [the source](https://github.com/robcast/digilib/tree/master/pdf)).
149+
`-Ppdf` builds digilib with the "PDFGenerator" servlet to generate and download PDF files from images.
150+
(see [the documentation](pdf-generator.html)).
151151

152152
## create-sprites
153153

doc/src/site/markdown/features.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@
2929
* **IIIF image API**: the digilib server provides [IIIF](http://iiif.io)
3030
image API (V2.1) compliant access to your images besides the digilib native server API.
3131

32+
* **PDF generation**: the [PDFGenerator](pdf-generation.html) servlet can create custom
33+
PDF documents from images on the server.
34+
3235
* **OpenId Connect authentication**: the digilib server can use authentication
3336
information from an [OpenId Connect](http://openid.net/) identity server.
3437
See the [authorization](auth.html) documentation.
3538

3639
* **CDSTAR storage backend**: the digilib server can access files on a [CDSTAR](https://cdstar.gwdg.de/) storage server.
3740

38-
* **plugins**: there are several Digilib plugins written in Javascript to add functionality to the client side, making use of jQuery features. See the [plugins](plugins.html) documentation.
41+
* **client plugins**: there are several Digilib plugins written in Javascript to add functionality to the client side, making use of jQuery features. See the [plugins](plugins.html) documentation.
3942

4043
* **digilib client API**: modify the settings, write Javascript functions or provide your own Digilib plugins and event handlers.

doc/src/site/markdown/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
## digilib resources
2727

28-
<code>digilib</code> source code, binaries and documentation can be found on the
28+
**digilib** source code, binaries and documentation can be found on the
2929
[digilib project pages](https://github.com/robcast/digilib)
3030
on [GitHub](https://github.com).
3131

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# PDF generator
2+
3+
The digilib `PDFGenerator` servlet creates custom PDF documents from images on the server
4+
for download by the user. The user can specify the sequence of images, the image resolution
5+
and information for the generated cover page of the document. The frontend will reload
6+
the status page until the document has been generated and then download the document.
7+
Generated documents will be cached on the server to speed up subsequent requests for the same document.
8+
9+
## Installation
10+
11+
The `PDFGenerator` servlet and its frontend are built by the `pdf` and `frontend-pdf` modules.
12+
You can add both to the [manual build process](build-maven.html) using the `-Ppdf` option but it is
13+
easier to include the generated artifacts the `pom.xml` of your own Maven project:
14+
15+
```
16+
<dependency>
17+
<groupId>digilib</groupId>
18+
<artifactId>digilib-frontend-pdf</artifactId>
19+
<version>2.10.0</version>
20+
<type>war</type>
21+
<scope>runtime</scope>
22+
</dependency>
23+
```
24+
25+
(see https://github.com/robcast/digilib-frontend-template for a basic setup)
26+
27+
## Request
28+
29+
The `PDFGenerator` servlet accepts the first request as a HTTP POST request with the following parameters:
30+
31+
`fn`
32+
: image directory path name (required)
33+
34+
`pgs`
35+
: image sequence specification (required) examples: "1-" (all pages), "1-5", "5,10,15", "1-7,9-13"
36+
37+
`dw`
38+
: pixel image width (optional)
39+
40+
`dh`
41+
: pixel image height (optional, default 500)
42+
43+
`logo`
44+
: url of header logo for cover page (optional)
45+
46+
`header-title`
47+
: header title for cover page (optional)
48+
49+
`header-subtitle`
50+
: header subtitle for cover page (optional)
51+
52+
`title`
53+
: document title for cover page (optional)
54+
55+
`author`
56+
: document author for cover page (optional)
57+
58+
`date`
59+
: document date for cover page (optional)
60+
61+
`reference`
62+
: document full reference for cover page (optional, alternative to title, author, date)
63+
64+
`online-url`
65+
: footer online url for cover page (optional)
66+
67+
The very simple but functional HTML form `/pdf/form.jsp` can be used as a starting point for customization.
68+
69+
The response to the first post request is a redirect to a HTTP GET request with an added `docid`
70+
parameter identifying the requested document. The following GET requests must provide the `docid`
71+
parameter and the response will be either a work-in-progress waiting page, an error page or the final document
72+
download.
73+
74+
The `PDFGenerator` servlet can also be queried as a ReST-style API. Responses will be given as
75+
JSON documents with the keys `docid`, `status` and `message` if the request carries the `Accept`
76+
header value `application/json`.
77+
78+
## iText PDF license
79+
80+
The `PDFGenerator` servlet uses the [iText PDF library](https://itextpdf.com).
81+
You can use it either under an [AGPL license](https://itextpdf.com/en/how-buy/agpl-license)
82+
or request a commercial license from the vendor.

doc/src/site/site.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<item name="Directory layout" href="image-directories.html"/>
4545
<item name="Java settings and tuning" href="java-settings.html"/>
4646
<item name="Access control" href="auth.html"/>
47+
<item name="PDF generation" href="pdf-generator.html"/>
4748
</menu>
4849
<menu name="Development">
4950
<item name="The digilib Scaler API" href="scaler-api.html"/>

0 commit comments

Comments
 (0)