{"_id":"@cley_faye/pdf-overlay","_rev":"4-56d1e7412e9cadaac96fca949f938277","name":"@cley_faye/pdf-overlay","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"@cley_faye/pdf-overlay","version":"1.0.0","bin":{"textoverlay":"bin/textoverlay.js"},"description":"Add an overlay to all pages of a PDF","main":"index.js","scripts":{"clean":"scripts/clean.sh","build":"npx tsc","prepack":"npm run clean && npm run build","check":"npm run clean && npx tsc --noEmit && npx eslint ."},"type":"module","repository":{"type":"git","url":"git@ukyo.cleyfaye.net:cleyfaye/pdf-overlay.git"},"keywords":["pdf","overlay"],"author":{"name":"Gabriel Paul \"Cley Faye\" Risterucci"},"license":"MIT","devDependencies":{"@keeex/eslint-config":"^1.9.3","@types/node":"^18.14.2","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","eslint":"^8.35.0","eslint-plugin-deprecation":"^1.3.3","eslint-plugin-import":"^2.27.5","eslint-plugin-promise":"^6.1.1","ts-node":"^10.9.1","typescript":"^4.9.5"},"dependencies":{"pdf-lib":"^1.17.1"},"gitHead":"ccc70084394996438208b331356a446172791e7c","_id":"@cley_faye/pdf-overlay@1.0.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-SiVxI/dirDn7Lj3qNE0eRChrQxd2KIlxOEoqbLaVzf10ToJwrZEVFLTmq+MPjnDNxKEGsHhi4SD2xehim7UCFA==","shasum":"daf1cbca5940a1d6802b0514203ac702f5a7ad8f","tarball":"https://registry.npmjs.org/@cley_faye/pdf-overlay/-/pdf-overlay-1.0.0.tgz","fileCount":8,"unpackedSize":110552,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG86/1iuciREFPaIG0bifflSaIp73ri6XRJkNYpVRlY/AiEAjwHflZ4vC71WYXqaQWFSykKfo33surNX29iD3zadN/s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/SacACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopnQ//WnTQ23LxAvnVJDYTKYLqyQw4+TuF7lRXTErPIxk7e7XthyMr\r\nDAi/oUMBsVR76fd86rquUnNAIuXhplq2ms95ddYvOHzKElMp+VXRG+DDbSDk\r\n/SE2/BkpBf1dWWuaLO9+I/L8b5BplZOo6le6nHfzhkcSuzDVqDv+yKq+qkHq\r\nDUJbb0KJzaQ78yMQeXWgR0E+cVj+4+FzFzhFc5NQi1RtBOMpzNXn3/nHSRhz\r\n/Hym0gg22CuDBF8wKSDqTVzwysIJ+ilLbynTVkpfAvfiNQZtnYtvAN2bzZD0\r\nZnvf1bTkOhrPM2Y3FsX2QRDD4MFRhMOypB/jKKgTB94gk1xv/z5Fd5yjeJOY\r\nTGjQbxYaPxRfhm6xfRax2cHMSzBOPGXUsGTgIxZOW6kpc8GwbknTQ+0sh58t\r\nqOooGIaWGpq27LpVVLKCLufbvLrNECDJlqNMq4xPzwccMxSK4pJi7OC0UvLh\r\nkDVN6pVAIF8iuaTPtReVFObjSx1x0KMjpkCHE1Nlji4CKdHm+po422luZa/N\r\nRAyylj4CraYllhX0D99ZmyDCxv1KE2cklMH6tCjG5Qov0mJq5ViY1cJyUf6Q\r\nZnZOyNJ75+vCPpRlpysFZ3nM/bOlBWRAx7f8flJj9yiJfUXtBu20kJ22HY6j\r\niHqWCZXW0wihzVRbmc9s4tp91861LBbluWE=\r\n=XNSp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cley_faye","email":"cleyfaye@gmail.com"},"directories":{},"maintainers":[{"name":"cley_faye","email":"cleyfaye@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pdf-overlay_1.0.0_1677534875907_0.7103240624599887"},"_hasShrinkwrap":true},"1.0.1":{"name":"@cley_faye/pdf-overlay","version":"1.0.1","bin":{"textoverlay":"bin/textoverlay.js"},"description":"Add an overlay to all pages of a PDF","main":"index.js","scripts":{"clean":"scripts/clean.sh","build":"npx tsc","prepack":"npm run clean && npm run build","check":"npm run clean && npx tsc --noEmit && npx eslint ."},"type":"module","repository":{"type":"git","url":"git@ukyo.cleyfaye.net:cleyfaye/pdf-overlay.git"},"keywords":["pdf","overlay"],"author":{"name":"Gabriel Paul \"Cley Faye\" Risterucci"},"license":"MIT","devDependencies":{"@keeex/eslint-config":"^1.9.3","@types/node":"^18.14.2","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","eslint":"^8.35.0","eslint-plugin-deprecation":"^1.3.3","eslint-plugin-import":"^2.27.5","eslint-plugin-promise":"^6.1.1","ts-node":"^10.9.1","typescript":"^4.9.5"},"dependencies":{"pdf-lib":"^1.17.1"},"gitHead":"1b93d0298aa9ca0dbbfb258ec53a81193cf2f838","_id":"@cley_faye/pdf-overlay@1.0.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-7Z33jZonVtJmxohSFF/4wWaxrwlvHFEe3mez1TgZAbJsoywHuNjyvCZjyi9RXPMtJDbVonMhgcG9S2Fkmucp+g==","shasum":"ad37fe38ee4ac1a0b7b28b18b6397e50924af241","tarball":"https://registry.npmjs.org/@cley_faye/pdf-overlay/-/pdf-overlay-1.0.1.tgz","fileCount":8,"unpackedSize":110578,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEy2blC9YQO4m0c+u3qIE+O3eWzVpR1iU8et6g1EkHWeAiAKWXvp8p54IQMtQaYUt9mmw4MCUkwoD5jWninIemO64g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/SdjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTeA//UJTC2uuv6vzOWPioK/Uq012SZqBIxmrx+hwagvMFwzblhHLY\r\npfKLkWQYChKa7XBDOKG3QL/6nD0ztwZhR6CmuaM3JhhJgl58X1q3DkR2eDAy\r\nJh1EDLGJWWSuKKTJEXwoRjRievPkBcDF7JoQL1W8BEAGES2tPANjRfX200sV\r\nRxWjkYJuQ9kTNC0nWzkA8kCDzOi+BZFH3+W2EC96lxZn3m0+MWhn4jmsfrTu\r\n0Tcoc0/xqflHKMQuIjSEEvgk0tbmVmXjctxpq/pFulEpMXsdCbs40Oy7/jZ/\r\nXfzOGw6vOuj3qZUFpt9CTJ48TG11s/J45ADYXvG+XmOq+Qay0U8PKtK8kChh\r\nki7ndQWJpG/Sx7Tn0JEXFnkqW9u+VAaOUEIlTggXJPfgB8WsehWdl6J9hQT7\r\nzC1mN2UjxDLbPwZ+HhY4Oj3BJKUxWGUUGVdvcte1In1vm11YQo8e156J/Syb\r\nsLUYUrjJ0Aruo/9jSnfdA6Ns/OJwYUPkQogwMnq5fDIRV8vQpF7t6tGQOy34\r\nsKkMLvRGGLlMU26yi/L8ulKofKF1gIrnQysca6Yp5pRLc/ZuGuy4cm9KiaqB\r\nHiWdoYTp7KmqIvU86M6oBkcjCi+2ZyEk67HCWnHiJPr9re80ytR8mZ8YErrK\r\nJsqeVkF9lzubVuLUMbWwlZWV5XMrndiTvig=\r\n=4WiD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cley_faye","email":"cleyfaye@gmail.com"},"directories":{},"maintainers":[{"name":"cley_faye","email":"cleyfaye@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pdf-overlay_1.0.1_1677535075285_0.7959266148719288"},"_hasShrinkwrap":true},"2.0.0":{"name":"@cley_faye/pdf-overlay","version":"2.0.0","bin":{"textoverlay":"bin/textoverlay.js"},"description":"Add an overlay to all pages of a PDF","main":"index.js","scripts":{"clean":"scripts/clean.sh","build":"npx tsc","prepack":"npm run clean && npm run build","check":"npm run clean && npx tsc --noEmit && npx eslint ."},"type":"module","repository":{"type":"git","url":"git@ukyo.cleyfaye.net:cleyfaye/pdf-overlay.git"},"keywords":["pdf","overlay"],"author":{"name":"Gabriel Paul \"Cley Faye\" Risterucci"},"license":"MIT","devDependencies":{"@keeex/eslint-config":"^1.11.5","@types/node":"^18.18.4","@typescript-eslint/eslint-plugin":"^6.7.5","@typescript-eslint/parser":"^6.7.5","eslint":"^8.51.0","eslint-plugin-deprecation":"^2.0.0","eslint-plugin-import":"^2.28.1","eslint-plugin-promise":"^6.1.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"dependencies":{"@keeex/js-utils":"^6.19.0","pdf-lib":"^1.17.1"},"gitHead":"babf357fbe0b270b9256a40932c98b43bce52418","_id":"@cley_faye/pdf-overlay@2.0.0","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-Aus01sOVge8xE0ZKQHCHpmjGhiQDyJj/UjTCvvvutgKvYqWQfqqtI8JpEKrUCntXhx1bzCbThfMJm1doZX0oMw==","shasum":"02fecb641dccd84ae4d502ec628c0dd1fb2b29c9","tarball":"https://registry.npmjs.org/@cley_faye/pdf-overlay/-/pdf-overlay-2.0.0.tgz","fileCount":8,"unpackedSize":13334,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfUpc2MkirKAL0H3NeOZmDFvloq0X1QyZTerYIpFVI3AiBccsSAPGRhhhlcZiw56yjP+I0zkgBIDF6adNO25kVWyA=="}]},"_npmUser":{"name":"cley_faye","email":"cleyfaye@gmail.com"},"directories":{},"maintainers":[{"name":"cley_faye","email":"cleyfaye@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pdf-overlay_2.0.0_1696887973777_0.06943287240045781"},"_hasShrinkwrap":false},"2.0.1":{"name":"@cley_faye/pdf-overlay","version":"2.0.1","bin":{"textoverlay":"bin/textoverlay.js"},"description":"Add an overlay to all pages of a PDF","main":"index.js","scripts":{"clean":"scripts/clean.sh","build":"npx tsc","prepack":"npm run clean && npm run build","check":"npm run clean && npx tsc --noEmit && npx eslint ."},"type":"module","repository":{"type":"git","url":"git@ukyo.cleyfaye.net:cleyfaye/pdf-overlay.git"},"keywords":["pdf","overlay"],"author":{"name":"Gabriel Paul \"Cley Faye\" Risterucci"},"license":"MIT","devDependencies":{"@keeex/eslint-config":"^1.11.5","@types/node":"^18.18.4","@typescript-eslint/eslint-plugin":"^6.7.5","@typescript-eslint/parser":"^6.7.5","eslint":"^8.51.0","eslint-plugin-deprecation":"^2.0.0","eslint-plugin-import":"^2.28.1","eslint-plugin-promise":"^6.1.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"dependencies":{"@keeex/js-utils":"^6.19.0","pdf-lib":"^1.17.1"},"gitHead":"aaa24b36b58b70d6c895bc0a0d5727fb662e1dc0","_id":"@cley_faye/pdf-overlay@2.0.1","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-BARfmbTHZz/l6SqUlngcxXWmpUYm7fzdq9pJOpRG0x+wpugmlMIt1YwoTjNsp9IAm/zn7F2cxQ1WKPWqcd2Arw==","shasum":"2602a6b9663aaa58495812ed668fcc26f2ddb7c8","tarball":"https://registry.npmjs.org/@cley_faye/pdf-overlay/-/pdf-overlay-2.0.1.tgz","fileCount":8,"unpackedSize":13323,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEzaysm3isIgtqldjEVX/G7TG4Pdbybq7SpeV5ldH0WkAiBAs3WVMAfIhXSoL7qwxeMoUJLya9radr+SJzM/KH//Ng=="}]},"_npmUser":{"name":"cley_faye","email":"cleyfaye@gmail.com"},"directories":{},"maintainers":[{"name":"cley_faye","email":"cleyfaye@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pdf-overlay_2.0.1_1696888427887_0.19866973535368815"},"_hasShrinkwrap":false},"3.0.0":{"name":"@cley_faye/pdf-overlay","version":"3.0.0","bin":{"textoverlay":"bin/textoverlay.js"},"description":"Add an overlay to all pages of a PDF","main":"index.js","scripts":{"clean":"scripts/clean.sh","build":"npx tsc","prepack":"npm run clean && npm run build","check":"npm run clean && npx tsc --noEmit && npx eslint ."},"type":"module","repository":{"type":"git","url":"git@ukyo.cleyfaye.net:cleyfaye/pdf-overlay.git"},"keywords":["pdf","overlay"],"author":{"name":"Gabriel Paul \"Cley Faye\" Risterucci"},"license":"MIT","devDependencies":{"@keeex/eslint-config":"^1.11.5","@types/node":"^18.19.1","@typescript-eslint/eslint-plugin":"^6.13.1","@typescript-eslint/parser":"^6.13.1","eslint":"^8.55.0","eslint-plugin-deprecation":"^2.0.0","eslint-plugin-import":"^2.29.0","eslint-plugin-promise":"^6.1.1","ts-node":"^10.9.1","typescript":"^5.3.2"},"dependencies":{"@keeex/js-utils":"^6.21.1","pdf-lib":"^1.17.1"},"gitHead":"67827fb02807e02a762a1ab0578421b2c8a11788","_id":"@cley_faye/pdf-overlay@3.0.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-uRkwCqO0kKJsZXdn+rjRozu0CqhVM7d4bKPj6BT+o1Dimx7Ckoi4vq6a0mvw28ToM7uvyq9Nfw/ZVGiuqDbbFw==","shasum":"8dcdd130bbc6573fda103db91d79b1e69f5e2d4b","tarball":"https://registry.npmjs.org/@cley_faye/pdf-overlay/-/pdf-overlay-3.0.0.tgz","fileCount":9,"unpackedSize":23192,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC30oldy9tdLWfQPoPAQ4e32SFv/HmQE/nK4hSVIrNCWQIhAKjuthXZKySkQ/TVpC3Pemf+5G1LDsVNWAr3drr5WWwg"}]},"_npmUser":{"name":"cley_faye","email":"cleyfaye@gmail.com"},"directories":{},"maintainers":[{"name":"cley_faye","email":"cleyfaye@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pdf-overlay_3.0.0_1701633008945_0.5310794751100225"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-27T21:54:35.832Z","1.0.0":"2023-02-27T21:54:36.071Z","modified":"2023-12-03T19:50:09.292Z","1.0.1":"2023-02-27T21:57:55.426Z","2.0.0":"2023-10-09T21:46:13.960Z","2.0.1":"2023-10-09T21:53:48.065Z","3.0.0":"2023-12-03T19:50:09.121Z"},"maintainers":[{"name":"cley_faye","email":"cleyfaye@gmail.com"}],"description":"Add an overlay to all pages of a PDF","keywords":["pdf","overlay"],"repository":{"type":"git","url":"git@ukyo.cleyfaye.net:cleyfaye/pdf-overlay.git"},"author":{"name":"Gabriel Paul \"Cley Faye\" Risterucci"},"license":"MIT","readme":"# `@cley_faye/pdf-overlay`\nAdd an overlay to all pages of a PDF.\n\nThis is a preliminary version; works as a CLI tool using Node.\n\n## Usage\nYou can use it without installation as long as NPM is available.\n\nPass the name of the config file as the only argument.\n\n```shell\nnpx --package=@cley_faye/pdf-overlay <config file>\n```\n\n## Configuration\nThe configuration must be provided in a JSON file with the following properties:\n\n```JavaScript\n{\n  \"inputPDF\": \"input.pdf\",\n  \"fileSource\": \"data.txt\",\n  \"outputDirectory\": \"output\",\n  \"filenameTemplate\": \"%{basename} - %{index} - %{text}\",\n  \"overlay\": [\n    {\n      \"position\": {\"horizontal\": \"left\", \"vertical\": \"top\"},\n      \"orientation\": \"horizontal\",\n      \"textTemplate\": \"%{text}\",\n      \"font\": \"Courier\",\n      \"size\": 12,\n      \"color\": {\"r\": 0, \"g\": 0, \"b\": 0},\n      \"opacity\": 1,\n      \"margin\": 0,\n      \"pages\": \"all\"\n    },\n    {\n      \"position\": {\"horizontal\": \"right\", \"vertical\": \"center\"},\n      \"orientation\": \"vertical\",\n      \"textTemplate\": \"Exemplaire %{index} / %{total}\",\n      \"font\": \"Courier\",\n      \"size\": 12,\n      \"color\": {\"r\": 0, \"g\": 0, \"b\": 0},\n      \"opacity\": 1,\n      \"margin\": 0\n      \"pages\": \"1\"\n    }\n  ]\n}\n```\n\n### `inputPDF`\nName of the input PDF file.\n\n### `fileSource`\nName of the file containing all the \"text\" to use for overlay, one per line.\n\n### `outputDirectory`\nDirectory to put the overlaid files into.\nOptional, defaults to \"output\".\n\n### `filenameTemplate`\nTemplate for the output filename.\nSee the \"Template string\" section below for more details.\nOptional, defaults to \"%{basename} - %{index} - %{text}\".\n\n### `overlay`\nDescribe the overlays to apply to each pages.\nThis property is an array and each entry is a single overlay text.\n\n#### `position`\nPosition of the overlay.\nIt is possible to specify a position in two ways:\n\n- absolute position, starting from the bottom-left corner of a page:\n  `{\"x\": 50, \"y\": 50}` (x is the horizontal offset, y the vertical one)\n- relative to a page's edge:\n  `{\"horizontal\": \"left\", \"vertical\": \"top\"}`\n\nFor the edge-based position, the valid values for `horizontal` are:\n\n- \"left\"\n- \"center\"\n- \"right\"\n\nThe valid values for `vertical` are:\n\n- \"top\"\n- \"center\"\n- \"bottom\"\n\n#### `textTemplate`\nThe text to stamp with this overlay.\nSee the \"Template string\" section below for more details.\n\n#### `font`\nFont for the text.\nCan be one of the standard PDF font:\n\n- \"Courier\"\n- \"CourierBold\"\n- \"CourierOblique\"\n- \"CourierBoldOblique\"\n- \"Helvetica\"\n- \"HelveticaBold\"\n- \"HelveticaOblique\"\n- \"HelveticaBoldOblique\"\n- \"TimesRoman\"\n- \"TimesRomanBold\"\n- \"TimesRomanItalic\"\n- \"TimesRomanBoldItalic\"\n- \"Symbol\"\n- \"ZapfDingbats\"\n\nAlternatively, it is possible to pass the path to a font file.\nOptional, defaults to \"Courier\".\n\n#### `orientation`\nChange the orientation of the text.\nPossible values:\n\n- \"horizontal\" (default value): text is horizontal\n- \"horizontalFlip\": text is flipped 180°\n- \"vertical\": text is vertical, rotated 90° clockwise from horizontal\n- \"verticalFlip\": text is vertical, rotated 90° counterclockwise from horizontal\n\n#### `size`\nFont size.\nOptional, defaults to 12.\n\n#### `color`\nColor for the text.\nMust be provided as a triple with `r` for red, `g` for green and `b` for blue.\nValues goes from 0 to 1.\nOptional, defaults to black.\n\n#### `opacity`\nText opacity.\nRange from 0 to 1.\nOptional, defaults to 1 (full opacity).\n\n#### `margin`\nMargin to add between the text and the page border.\nThe unit is… let's say points.\nOptional, defauls to 0.\n\n#### `pages`\nPages to put the overlay on.\nDefaults to all pages if not specified.\n\nTo define which page will get this specific overlay, you can use directives, which will be applied\nin the provided order.\nEach directives are separated by a semicolon.\n\nAvailable directives:\n\n- `all`: enable on all pages\n- `odd`: enable on odd pages\n- `even`: enable on even pages\n- `3`: enable on page 3 (any page number)\n- `-3`: disable on page 3 (any page number)\n- `4,7`: enable on pages 4 to 7 (included)\n- `-4,7`: disable on pages 4 to 7 (included)\n\nSome examples:\n\n- `all;-10`: enable on all pages except page 10\n- `odd;-11`: enable on all odd pages except page 11\n- `even;3;-22,36`: enable on all even pages plus page 3, except pages from 22 to 36\n- `34`: enable only on page 34\n- `34,1664;-63`: enable on pages from 34 to 1664 (included), except on page 63\n\n## Template string\nFor both the filename and the `textTemplate` properties in configuration, you can specify template\nvariables.\nTo do so, use this notation: `%{variable name}`.\n\nAvailable variables:\n\n- `index`: ID of the current output (starts at 1)\n- `total`: total number of files that will be produced\n- `text`: the line of text from the data source\n- `basename`: the name of the input PDF file\n\nThe following string is a working example:\n\n```raw\nFor %{text}, edition %{index} of %{total}\n```\n","readmeFilename":"README.md"}