# Wiki-to-print Wiki-to-print is used to make [Volumetric Regimes](http://www.data-browser.net/db08.html). `MediaWiki Unfolded page > update.py > MediaWiki API > Unfolded HTML page + images (saved to file) > Jinja template > CSS + Paged.js > PDF` ## Using the wiki-to-print publishing pipeline * `make wiki`: downloads the materials from the `Unfolded wiki page` and generates `Unfolded.html` * `make run`: runs a local server on port 8000 to preview the PDF at `http://localhost:8000/Unfolded.html` ## Tools * PDF rendering: Paged.js () * generate HTML: `update.py` is used to download the *Unfolded* wiki page to a local HTML file, download new images and rewrite/replace structural elements and details * hyphens: hyphenology, see `templates/template.html` and `js/runHyphens.js` * baseline grid: px calculation + manual shifts of images in `css/print.css` + `csss/baseline.css` * footnotes: are structured by MediaWiki and are wrapped in HTML elements when the content is pulled using the MediaWiki API * pre-press: see the folder `tools` for different scripts to convert PDF color space, PDF format, PDF resizing, and more ## Software dependencies * `jinja2==3.1.2` * `markupsafe==2.0.1` * `pdftk` (adding Multi) * `pdfunite` (adding Multi) * `resample` (PDF resizing) * `xelatex` (PDF formatting) ## Notes and contingent documentation * Notes, style/structure guide and a process log can be found here: * An attempt to document why sentences dissapear in Paged.js: ## Publishing pipeline continuations The choice to work with Mediawiki and web-to-print techniques, continues practices through which the following publications and tools emerged: * web-to-pdf (TiTiPi, Martino Morandi) http://titipi.org/wiki/index.php/Wiki-to-pdf, https://gitlab.constantvzw.org/titipi/wiki-to-pdf, http://titipi.org/wiki/index.php/Wiki-to-pdf-manual, http://titipi.org/wiki/index.php/Unfolding:Infrastructural_Interactions, http://titipi.org/wiki-to-pdf/pagedjs/Infrastructural_Interactions * DiVersions (Constant, OSP) https://www.books.constantvzw.org/home/diversions-v2, https://diversions.constantvzw.org/, https://diversions.constantvzw.org/wiki/index.php?title=PublicationUnfolded, http://osp.kitchen/work/diversions/, https://gitlab.constantvzw.org/osp/work.diversions * Mondoteque (Constant, André Castro, Alexia de Visscher) https://www.books.constantvzw.org/home/mondotheque, https://www.mondotheque.be/wiki/index.php?title=The_radiated_book * html2print (OSP), http://osp.kitchen/tools/html2print/ ## Other tools used for Volumetric Regimes See: `./tools/` Most of these tools are used for PDF manipulation. With a big thanks to OSP's PDFUTILS! ### OSP-tools.pdfutils: `color_convert.sh` **Convert PDF RGB to only-Black** This will convert an RGB PDF (even if it appears only black) to `input-K.pdf`. ./color_convert.sh black input.pdf input-K.pdf Link: ### OSP-tools.pdfutils: `rgb2cmyk.sh` **Convert PDF from RGB to CMYK** Dependencies: - `gs` (Ghostscript) - `pdftops` - `control.txt` - `apple_to_jNP_photo.icc` - `apple_to_jNP_neutral.icc` This will convert a PDF to `input-cmyk.pdf`. Usage: ./rgb2cmyk.sh input.pdf Link: ### OSP-tools.pdfutils: `rgb2cmyk-overprint.sh` **Convert PDF from RGB to CMYK, with overprint enabled on the whole document** Dependencies: - `gs` (Ghostscript) - `pdftops` - `control.txt` - `apple_to_jNP_photo.icc` - `apple_to_jNP_neutral.icc` This will convert a PDF to `input-CMYK-op.pdf`. Usage: ./rgb2cmyk-overprint.sh input.pdf Link: ### OSP-tools: `resample.sh` Dependencies: - `gs` (Ghostscript) This will change the resolution of a PDF. Usage: ./resample input.pdf 150 ### Custom VR tools: `make-images-bw.sh` Dependencies: - `imagemagick` This will create a copy of an image folder, with all images converted to BW. Usage: ./make-images-bw.sh ./images-folder/ ### Custom VR tools: `convert-to-PDFX-3-2002.sh` Dependencies: - `texlive-xetex` (xelatex) This will convert a PDF into the PDFX/3:2002 format + edit the PDF metadata. Edit PDF metadata: Open the xelatex template (`xelatex-PDFX-3-2002.template.tex`) and edit the metadata on line 7-12. Usage: convert-to-PDFX-3-2002.sh input.pdf output.pdf ### Custom VR tools: `separatecolors.sh` Dependencies: - `gs` (Ghostscript) This will convert the PDF into a set of TIFF files, which is useful to inspect how the colors are spread over the different color "plates". The script generates one TIFF for: - full color - cyan plate - magenta plate - yellow plate - black plate Usage: ./simulateoverprint.sh input.pdf ### Other useful tools - Check metadata of PDF: `pdfinfo filename.pdf` - Check color space of PDF: `pdfimages -list filename.pdf` - Check colors of PDF: `identify -verbose filename.pdf`