@chialab/pdfjs-lib 1.0.0-alpha.13 → 1.0.0-alpha.15
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 +15 -7
- package/dist/browser/index.js +3 -0
- package/dist/lib/AnnotationData.d.ts +5 -6
- package/dist/node/index.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
- Browser and Node (and Bun) optimized builds using ES modules
|
|
11
|
+
- Bundler-friendly
|
|
12
|
+
- Polyfills included
|
|
13
|
+
- Extended annotation models support
|
|
14
|
+
- SVG renderer for PDF pages
|
|
15
|
+
- Improved TextLayer extraction with structure information
|
|
16
16
|
|
|
17
17
|
## Install
|
|
18
18
|
|
|
@@ -26,4 +26,12 @@ yarn add @chialab/pdfjs-lib
|
|
|
26
26
|
|
|
27
27
|
```
|
|
28
28
|
pnpm add @chialab/pdfjs-lib
|
|
29
|
-
```
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Before building
|
|
32
|
+
|
|
33
|
+
Before building the library:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
git submodule init && git submodule update
|
|
37
|
+
```
|
package/dist/browser/index.js
CHANGED
|
@@ -25929,6 +25929,9 @@ async function createTextLayer(page, {
|
|
|
25929
25929
|
scale: 1,
|
|
25930
25930
|
angle: 0
|
|
25931
25931
|
};
|
|
25932
|
+
if (geom.hasEOL) {
|
|
25933
|
+
textDiv.text = textDiv.text.replace(/\s*$/, "\n");
|
|
25934
|
+
}
|
|
25932
25935
|
textDivs.push(textDiv);
|
|
25933
25936
|
const tx = Util.transform(transform, geom.transform);
|
|
25934
25937
|
let angle = Math.atan2(tx[1], tx[0]);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { SvgRoot } from './SvgCanvasContext';
|
|
2
|
-
type Rect = [number, number, number, number];
|
|
3
|
-
type Color = [number, number, number];
|
|
4
|
-
type Dir = 'ltr' | 'rtl';
|
|
5
|
-
declare enum BorderStyle {
|
|
2
|
+
export type Rect = [number, number, number, number];
|
|
3
|
+
export type Color = [number, number, number];
|
|
4
|
+
export type Dir = 'ltr' | 'rtl';
|
|
5
|
+
export declare enum BorderStyle {
|
|
6
6
|
SOLID = 1,
|
|
7
7
|
DASHED = 2
|
|
8
8
|
}
|
|
9
|
-
declare enum LineEnding {
|
|
9
|
+
export declare enum LineEnding {
|
|
10
10
|
NONE = "None",
|
|
11
11
|
SQUARE = "Square",
|
|
12
12
|
CIRCLE = "Circle",
|
|
@@ -202,4 +202,3 @@ export declare function isTrapNetAnnotation(annotation: AnnotationData): annotat
|
|
|
202
202
|
export declare function isWatermarkAnnotation(annotation: AnnotationData): annotation is WatermarkAnnotationData;
|
|
203
203
|
export declare function isThreeDAnnotation(annotation: AnnotationData): annotation is ThreeDAnnotationData;
|
|
204
204
|
export declare function isRedactAnnotation(annotation: AnnotationData): annotation is RedactAnnotationData;
|
|
205
|
-
export {};
|
package/dist/node/index.js
CHANGED
|
@@ -26536,6 +26536,9 @@ async function createTextLayer(page, {
|
|
|
26536
26536
|
scale: 1,
|
|
26537
26537
|
angle: 0
|
|
26538
26538
|
};
|
|
26539
|
+
if (geom.hasEOL) {
|
|
26540
|
+
textDiv.text = textDiv.text.replace(/\s*$/, "\n");
|
|
26541
|
+
}
|
|
26539
26542
|
textDivs.push(textDiv);
|
|
26540
26543
|
const tx = Util.transform(transform, geom.transform);
|
|
26541
26544
|
let angle = Math.atan2(tx[1], tx[0]);
|
package/package.json
CHANGED