diff --git a/doc/pom.xml b/doc/pom.xml index 07b5d915..07141e88 100644 --- a/doc/pom.xml +++ b/doc/pom.xml @@ -15,7 +15,7 @@ org.apache.maven.plugins maven-site-plugin - 3.8.2 + 3.9.1 true @@ -23,7 +23,7 @@ org.apache.maven.doxia doxia-module-markdown - 1.9 + 1.9.1 diff --git a/doc/src/site/markdown/build-maven.md b/doc/src/site/markdown/build-maven.md index 8ace6337..19189bcb 100644 --- a/doc/src/site/markdown/build-maven.md +++ b/doc/src/site/markdown/build-maven.md @@ -146,8 +146,8 @@ to add `-Pservlet3` or `-Pservlet2` as well. ### pdf -`-Ppdf` builds digilib with the "PDFCache" servlet to generate and download PDF files from images. -(see [the source](https://github.com/robcast/digilib/tree/master/pdf)). +`-Ppdf` builds digilib with the "PDFGenerator" servlet to generate and download PDF files from images. +(see [the documentation](pdf-generator.html)). ## create-sprites diff --git a/doc/src/site/markdown/features.md b/doc/src/site/markdown/features.md index 21699e15..9abcb777 100644 --- a/doc/src/site/markdown/features.md +++ b/doc/src/site/markdown/features.md @@ -29,12 +29,15 @@ * **IIIF image API**: the digilib server provides [IIIF](http://iiif.io) image API (V2.1) compliant access to your images besides the digilib native server API. +* **PDF generation**: the [PDFGenerator](pdf-generation.html) servlet can create custom + PDF documents from images on the server. + * **OpenId Connect authentication**: the digilib server can use authentication information from an [OpenId Connect](http://openid.net/) identity server. See the [authorization](auth.html) documentation. * **CDSTAR storage backend**: the digilib server can access files on a [CDSTAR](https://cdstar.gwdg.de/) storage server. -* **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. +* **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. * **digilib client API**: modify the settings, write Javascript functions or provide your own Digilib plugins and event handlers. \ No newline at end of file diff --git a/doc/src/site/markdown/index.md b/doc/src/site/markdown/index.md index 41cfe8bd..197ebf6f 100644 --- a/doc/src/site/markdown/index.md +++ b/doc/src/site/markdown/index.md @@ -25,7 +25,7 @@ ## digilib resources -digilib source code, binaries and documentation can be found on the +**digilib** source code, binaries and documentation can be found on the [digilib project pages](https://github.com/robcast/digilib) on [GitHub](https://github.com). diff --git a/doc/src/site/markdown/pdf-generator.md b/doc/src/site/markdown/pdf-generator.md new file mode 100644 index 00000000..875b5f6d --- /dev/null +++ b/doc/src/site/markdown/pdf-generator.md @@ -0,0 +1,82 @@ +# PDF generator + +The digilib `PDFGenerator` servlet creates custom PDF documents from images on the server +for download by the user. The user can specify the sequence of images, the image resolution +and information for the generated cover page of the document. The frontend will reload +the status page until the document has been generated and then download the document. +Generated documents will be cached on the server to speed up subsequent requests for the same document. + +## Installation + +The `PDFGenerator` servlet and its frontend are built by the `pdf` and `frontend-pdf` modules. +You can add both to the [manual build process](build-maven.html) using the `-Ppdf` option but it is +easier to include the generated artifacts the `pom.xml` of your own Maven project: + +``` + + digilib + digilib-frontend-pdf + 2.10.0 + war + runtime + +``` + +(see https://github.com/robcast/digilib-frontend-template for a basic setup) + +## Request + +The `PDFGenerator` servlet accepts the first request as a HTTP POST request with the following parameters: + +`fn` +: image directory path name (required) + +`pgs` +: image sequence specification (required) examples: "1-" (all pages), "1-5", "5,10,15", "1-7,9-13" + +`dw` +: pixel image width (optional) + +`dh` +: pixel image height (optional, default 500) + +`logo` +: url of header logo for cover page (optional) + +`header-title` +: header title for cover page (optional) + +`header-subtitle` +: header subtitle for cover page (optional) + +`title` +: document title for cover page (optional) + +`author` +: document author for cover page (optional) + +`date` +: document date for cover page (optional) + +`reference` +: document full reference for cover page (optional, alternative to title, author, date) + +`online-url` +: footer online url for cover page (optional) + +The very simple but functional HTML form `/pdf/form.jsp` can be used as a starting point for customization. + +The response to the first post request is a redirect to a HTTP GET request with an added `docid` +parameter identifying the requested document. The following GET requests must provide the `docid` +parameter and the response will be either a work-in-progress waiting page, an error page or the final document +download. + +The `PDFGenerator` servlet can also be queried as a ReST-style API. Responses will be given as +JSON documents with the keys `docid`, `status` and `message` if the request carries the `Accept` +header value `application/json`. + +## iText PDF license + +The `PDFGenerator` servlet uses the [iText PDF library](https://itextpdf.com). +You can use it either under an [AGPL license](https://itextpdf.com/en/how-buy/agpl-license) +or request a commercial license from the vendor. diff --git a/doc/src/site/site.xml b/doc/src/site/site.xml index f0a99989..47fc5904 100644 --- a/doc/src/site/site.xml +++ b/doc/src/site/site.xml @@ -44,6 +44,7 @@ +