formatferry 1.0.27 → 1.0.29
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.
- package/README.md +27 -0
- package/dist/index.js +39253 -545
- package/package.json +14 -6
package/README.md
CHANGED
|
@@ -27,6 +27,33 @@ formatferry -i paper.pdf -o paper.md
|
|
|
27
27
|
formatferry -i data.xlsx -o data.md
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
## Scanned PDFs
|
|
31
|
+
|
|
32
|
+
The CLI extracts a PDF's existing text layer. It does **not** run OCR, so a
|
|
33
|
+
scanned or image-only PDF has no text to extract and the conversion fails:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
$ formatferry -i scan.pdf
|
|
37
|
+
Error [IMAGE_ONLY]: PDF contains only images — no text layer available. OCR is not enabled in this environment.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
OCR is a browser-only feature: it runs on-device via Tesseract at
|
|
41
|
+
[formatferry.vibingfun.com](https://formatferry.vibingfun.com), where scanned
|
|
42
|
+
pages inside a PDF are recognized page by page and merged with the pages that
|
|
43
|
+
already have real text. It is deliberately absent here — the CLI ships no WASM
|
|
44
|
+
OCR engine, which keeps the install small and the conversion fully offline.
|
|
45
|
+
|
|
46
|
+
For a PDF that mixes real text pages with scanned inserts, the conversion
|
|
47
|
+
**succeeds** and the scanned pages come through empty. The document has enough
|
|
48
|
+
text elsewhere to avoid the `IMAGE_ONLY` error above, so the exit code is 0 and
|
|
49
|
+
the only sign is a page heading with nothing under it. Check the output when a
|
|
50
|
+
PDF may contain scans — for this case the CLI cannot tell you which pages it
|
|
51
|
+
could not read, because no OCR ran and so nothing reported a per-page failure.
|
|
52
|
+
|
|
53
|
+
Conversion warnings that *are* produced (for example unusual table structures)
|
|
54
|
+
are written to stderr, never stdout, so `formatferry -i doc.pdf > out.md` keeps
|
|
55
|
+
the Markdown clean while still showing you the warnings.
|
|
56
|
+
|
|
30
57
|
## Commands
|
|
31
58
|
|
|
32
59
|
### Convert (default)
|