pdf-writer
v1.1.2
Published
Overlays text on PDFs.
Downloads
233
Maintainers
Readme
PDF Writer
This script generates text-only PDFs by reading configuration from a JSON file. It can also overlay text on existing PDFs using QPDF.
Installation and usage
npm i -g pdf-writer
pdf-writer <path to a JSON file>
JSON format
See example/example.json
for reference.
A few notes:
- Width and height of a sheet are specified in millimeters.
x
andwidth
are relative to the width of the page;y
andlineGap
are relative to the height of the page.- Default value for
align
iscenter
and forverticalAlign
ismiddle
: you don’t need to specify them explicitly. continuation
only works for single-line labels.
This script uses QPDF for overlaying text on existing PDFs. An example of how to achieve this can be found in the example file: see the line with the postprocess
configuration. If you don’t have QPDF installed, remove this line in order to be able to run the example.