@scanmate/merge 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,14 +1,24 @@
1
- ![scanmate merge](./scanmate-merge.svg)
1
+ ![scanmate merge](./assets/scanmate-merge.svg)
2
2
 
3
3
  # `@scanmate/merge`
4
4
 
5
5
  PDFs, images and rasters into one PDF, in the order given and mixed freely.
6
6
 
7
+ ![three photographed pages and a PDF, merged into one document](./assets/merged.jpg)
8
+
9
+ *Three photographed pages and a PDF, in one document: the JPEGs embedded as their own bytes, the PDF's pages copied, never re-rendered. Made from the [IRS Form W-9](https://www.irs.gov/pub/irs-pdf/fw9.pdf) (a work of the United States government, in the public domain): filled in as a generator would, printed, signed by hand and scanned crooked.*
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install @scanmate/merge
15
+ ```
16
+
7
17
  ```ts
8
18
  import { mergeDocuments } from '@scanmate/merge'
9
19
 
10
- // What a person uploaded, page by page, as one document:
11
- const { pdf, pages } = await mergeDocuments(['page-1.jpg', 'page-2.jpg', 'annex.pdf'])
20
+ // The picture above: three photographed pages, then a PDF, as one document.
21
+ const { pdf, pages } = await mergeDocuments(['page-1.jpg', 'page-2.jpg', 'page-3.jpg', 'fw9-issued.pdf'])
12
22
 
13
23
  // A pipeline's aligned pages as one evidence file:
14
24
  const evidence = await mergeDocuments(
@@ -47,3 +57,7 @@ Each entry in `pages` says which source and source page it came from, how it was
47
57
  Measured on real scans: three 120-dpi page JPEGs plus a 7-page PDF merged in 20 ms (0.73 MB). Seven aligned pages made a 3.3 MB PNG or 0.74 MB JPEG evidence file.
48
58
 
49
59
  PDF writing uses `@cantoo/pdf-lib`, the maintained fork of pdf-lib, which is pure JavaScript with nothing to install on the host.
60
+
61
+ ## How it decides
62
+
63
+ [`documentation/algorithms.md`](./documentation/algorithms.md) has the algorithms in full: what each step measures, the decision flows, every constant with the measurement behind it, and what the package deliberately does not do.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scanmate/merge",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Merge PDFs, images and rasters into one PDF: PDF pages copied as they are, JPEGs embedded without recompression, every page of a TIFF.",
5
5
  "license": "MIT",
6
6
  "author": "Eduardo Russo",
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@cantoo/pdf-lib": "^2.11.1",
44
- "@scanmate/ink": "^0.0.2"
44
+ "@scanmate/ink": "^0.0.3"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"