@boxpdf/html-writer 0.1.1 → 0.1.2
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 +6 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# `@boxpdf/html-writer`
|
|
2
2
|
|
|
3
|
-
Streams text-oriented HTML from pages produced by `@boxpdf/reader`.
|
|
4
|
-
PDF-to-HTML package; it is intentionally named differently from `boxpdf-html`,
|
|
5
|
-
which converts HTML in the opposite direction.
|
|
3
|
+
Streams text-oriented HTML from pages produced by `@boxpdf/reader`.
|
|
6
4
|
|
|
7
5
|
```ts
|
|
8
6
|
import { open } from "node:fs/promises";
|
|
@@ -26,8 +24,8 @@ try {
|
|
|
26
24
|
```
|
|
27
25
|
|
|
28
26
|
The default `positioned` layout preserves text coordinates. The optional
|
|
29
|
-
`flow` layout uses the reader's inferred lines and tables.
|
|
30
|
-
graphics, and exact font reproduction
|
|
27
|
+
`flow` layout uses the reader's inferred lines and tables. The current output
|
|
28
|
+
surface excludes images, vector graphics, and exact font reproduction.
|
|
31
29
|
|
|
32
30
|
The callback is awaited for every chunk, so a file stream, HTTP response, or
|
|
33
31
|
Web `WritableStream` can apply backpressure. The caller owns and closes the PDF
|
|
@@ -39,9 +37,9 @@ or allowlist user-provided PDF URLs before passing them to the HTTP example.
|
|
|
39
37
|
## Compatibility oracle
|
|
40
38
|
|
|
41
39
|
Tests compare normalized page geometry, text, and anchor positions with
|
|
42
|
-
Poppler's `pdftohtml -c -hidden -noframes -zoom 1` output. Poppler
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
Poppler's `pdftohtml -c -hidden -noframes -zoom 1` output. Poppler serves as an
|
|
41
|
+
independent test oracle. The writer's memory contract covers the reader and
|
|
42
|
+
HTML serialization.
|
|
45
43
|
|
|
46
44
|
`pnpm poppler:report` runs the positioned writer over all 62 text fixtures in
|
|
47
45
|
the pinned PDF.js corpus. The checked-in baseline currently records exact text
|