fieldpapers/fp-printer

Name: fp-printer

Owner: Field Papers

Description: Field Papers printing

Created: 2015-02-27 02:36:41.0

Updated: 2017-11-15 19:13:00.0

Pushed: 2015-02-27 03:15:55.0

Homepage: null

Size: 95

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Field Papers Printer

This repository contains (or will) Field Papers' atlas creation pipeline.

This pipeline involves outputting an atlas-specific HTML page containing page breaks (as appropriate), intended for output as a PDF using wktopdf.

Installation

Install wkhtmltopdf. The OS X installer unfortunate side-effect of resetting permissions on some folders within /usr/local (if you're using Homebrew).

Printing

To create a PDF:

mltopdf http://host/path atlas.pdf

By default, this will produce A4-sized portrait output. To change the orientation, use -O Landscape. To change the paper size, use -s Letter (etc.).

High Resolution Map Output

Standard images for the web are 72dpi. Retina images (@2x) are twice that, at 144dpi. Since we're generating output intended for print, we'd like to get to 300dpi if possible. Using standard tiles, we can offset by 2 zoom levels and shrink the effective image size to 64px (substantially shrinking the size of features and text). This can be done in Leaflet like so:

leLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
leSize: 64,
omOffset: 2
ddTo(map);

Retina tiles (512x512px) can target the same resolution and only offset by a single zoom:

leLayer("http://{s}.tile.stamen.com/toner-lite/{z}/{x}/{y}@2x.png", {
leSize: 128,
omOffset: 1
ddTo(map);

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.