@robinpath/pdf 0.1.3 → 0.1.5
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 +94 -94
- package/package.json +4 -8
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -12
- package/dist/index.js.map +0 -1
- package/dist/pdf.d.ts +0 -100
- package/dist/pdf.d.ts.map +0 -1
- package/dist/pdf.js +0 -405202
- package/dist/pdf.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
# @robinpath/pdf
|
|
2
|
-
|
|
3
|
-
> PDF generation (documents, tables, HTML-to-PDF) and parsing (text extraction, metadata, page count)
|
|
4
|
-
|
|
5
|
-
   
|
|
6
|
-
|
|
7
|
-
## Why use this module?
|
|
8
|
-
|
|
9
|
-
The `pdf` module lets you:
|
|
10
|
-
|
|
11
|
-
- Generate a PDF document with title, content, and sections
|
|
12
|
-
- Parse a PDF file and extract text, metadata, and page count
|
|
13
|
-
- Extract all text from a PDF file
|
|
14
|
-
- Get the number of pages in a PDF
|
|
15
|
-
- Get PDF metadata (author, title, creation date, etc.)
|
|
16
|
-
|
|
17
|
-
All functions are callable directly from RobinPath scripts with a simple, consistent API.
|
|
18
|
-
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm install @robinpath/pdf
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Quick Start
|
|
26
|
-
|
|
27
|
-
No credentials needed — start using it right away:
|
|
28
|
-
|
|
29
|
-
```robinpath
|
|
30
|
-
pdf.parse "./document.pdf"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Available Functions
|
|
34
|
-
|
|
35
|
-
| Function | Description |
|
|
36
|
-
|----------|-------------|
|
|
37
|
-
| `pdf.generate` | Generate a PDF document with title, content, and sections |
|
|
38
|
-
| `pdf.parse` | Parse a PDF file and extract text, metadata, and page count |
|
|
39
|
-
| `pdf.extractText` | Extract all text from a PDF file |
|
|
40
|
-
| `pdf.pageCount` | Get the number of pages in a PDF |
|
|
41
|
-
| `pdf.metadata` | Get PDF metadata (author, title, creation date, etc.) |
|
|
42
|
-
| `pdf.generateTable` | Generate a PDF with a formatted table |
|
|
43
|
-
| `pdf.generateFromHtml` | Generate a PDF from basic HTML content |
|
|
44
|
-
|
|
45
|
-
## Examples
|
|
46
|
-
|
|
47
|
-
### Parse a PDF file and extract text, metadata, and page count
|
|
48
|
-
|
|
49
|
-
```robinpath
|
|
50
|
-
pdf.parse "./document.pdf"
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Extract all text from a PDF file
|
|
54
|
-
|
|
55
|
-
```robinpath
|
|
56
|
-
pdf.extractText "./document.pdf"
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Get the number of pages in a PDF
|
|
60
|
-
|
|
61
|
-
```robinpath
|
|
62
|
-
pdf.pageCount "./document.pdf"
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Integration with RobinPath
|
|
66
|
-
|
|
67
|
-
```typescript
|
|
68
|
-
import { RobinPath } from "@wiredwp/robinpath";
|
|
69
|
-
import Module from "@robinpath/pdf";
|
|
70
|
-
|
|
71
|
-
const rp = new RobinPath();
|
|
72
|
-
rp.registerModule(Module.name, Module.functions);
|
|
73
|
-
rp.registerModuleMeta(Module.name, Module.functionMetadata);
|
|
74
|
-
|
|
75
|
-
const result = await rp.executeScript(`
|
|
76
|
-
pdf.parse "./document.pdf"
|
|
77
|
-
`);
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Full API Reference
|
|
81
|
-
|
|
82
|
-
See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
|
|
83
|
-
|
|
84
|
-
## Related Modules
|
|
85
|
-
|
|
86
|
-
- [`@robinpath/excel`](../excel) — Excel module for complementary functionality
|
|
87
|
-
- [`@robinpath/office`](../office) — Office module for complementary functionality
|
|
88
|
-
- [`@robinpath/docusign`](../docusign) — DocuSign module for complementary functionality
|
|
89
|
-
- [`@robinpath/pandadoc`](../pandadoc) — PandaDoc module for complementary functionality
|
|
90
|
-
- [`@robinpath/hellosign`](../hellosign) — HelloSign module for complementary functionality
|
|
91
|
-
|
|
92
|
-
## License
|
|
93
|
-
|
|
94
|
-
MIT
|
|
1
|
+
# @robinpath/pdf
|
|
2
|
+
|
|
3
|
+
> PDF generation (documents, tables, HTML-to-PDF) and parsing (text extraction, metadata, page count)
|
|
4
|
+
|
|
5
|
+
   
|
|
6
|
+
|
|
7
|
+
## Why use this module?
|
|
8
|
+
|
|
9
|
+
The `pdf` module lets you:
|
|
10
|
+
|
|
11
|
+
- Generate a PDF document with title, content, and sections
|
|
12
|
+
- Parse a PDF file and extract text, metadata, and page count
|
|
13
|
+
- Extract all text from a PDF file
|
|
14
|
+
- Get the number of pages in a PDF
|
|
15
|
+
- Get PDF metadata (author, title, creation date, etc.)
|
|
16
|
+
|
|
17
|
+
All functions are callable directly from RobinPath scripts with a simple, consistent API.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @robinpath/pdf
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
No credentials needed — start using it right away:
|
|
28
|
+
|
|
29
|
+
```robinpath
|
|
30
|
+
pdf.parse "./document.pdf"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Available Functions
|
|
34
|
+
|
|
35
|
+
| Function | Description |
|
|
36
|
+
|----------|-------------|
|
|
37
|
+
| `pdf.generate` | Generate a PDF document with title, content, and sections |
|
|
38
|
+
| `pdf.parse` | Parse a PDF file and extract text, metadata, and page count |
|
|
39
|
+
| `pdf.extractText` | Extract all text from a PDF file |
|
|
40
|
+
| `pdf.pageCount` | Get the number of pages in a PDF |
|
|
41
|
+
| `pdf.metadata` | Get PDF metadata (author, title, creation date, etc.) |
|
|
42
|
+
| `pdf.generateTable` | Generate a PDF with a formatted table |
|
|
43
|
+
| `pdf.generateFromHtml` | Generate a PDF from basic HTML content |
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
### Parse a PDF file and extract text, metadata, and page count
|
|
48
|
+
|
|
49
|
+
```robinpath
|
|
50
|
+
pdf.parse "./document.pdf"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Extract all text from a PDF file
|
|
54
|
+
|
|
55
|
+
```robinpath
|
|
56
|
+
pdf.extractText "./document.pdf"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Get the number of pages in a PDF
|
|
60
|
+
|
|
61
|
+
```robinpath
|
|
62
|
+
pdf.pageCount "./document.pdf"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Integration with RobinPath
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { RobinPath } from "@wiredwp/robinpath";
|
|
69
|
+
import Module from "@robinpath/pdf";
|
|
70
|
+
|
|
71
|
+
const rp = new RobinPath();
|
|
72
|
+
rp.registerModule(Module.name, Module.functions);
|
|
73
|
+
rp.registerModuleMeta(Module.name, Module.functionMetadata);
|
|
74
|
+
|
|
75
|
+
const result = await rp.executeScript(`
|
|
76
|
+
pdf.parse "./document.pdf"
|
|
77
|
+
`);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Full API Reference
|
|
81
|
+
|
|
82
|
+
See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
|
|
83
|
+
|
|
84
|
+
## Related Modules
|
|
85
|
+
|
|
86
|
+
- [`@robinpath/excel`](../excel) — Excel module for complementary functionality
|
|
87
|
+
- [`@robinpath/office`](../office) — Office module for complementary functionality
|
|
88
|
+
- [`@robinpath/docusign`](../docusign) — DocuSign module for complementary functionality
|
|
89
|
+
- [`@robinpath/pandadoc`](../pandadoc) — PandaDoc module for complementary functionality
|
|
90
|
+
- [`@robinpath/hellosign`](../hellosign) — HelloSign module for complementary functionality
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robinpath/pdf",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "PDF generation from HTML/text and text extraction from PDFs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,15 +22,11 @@
|
|
|
22
22
|
"test": "node --import tsx --test tests/*.test.ts"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@
|
|
26
|
-
},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"pdfkit": "^0.15.0",
|
|
29
|
-
"pdf-parse": "^1.1.1"
|
|
25
|
+
"@robinpath/core": ">=0.20.0"
|
|
30
26
|
},
|
|
27
|
+
"dependencies": {},
|
|
31
28
|
"devDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@types/pdfkit": "^0.13.0",
|
|
29
|
+
"@robinpath/core": "^0.30.1",
|
|
34
30
|
"tsx": "^4.19.0",
|
|
35
31
|
"typescript": "^5.6.0"
|
|
36
32
|
},
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ModuleAdapter } from "@wiredwp/robinpath";
|
|
2
|
-
declare const PdfModule: ModuleAdapter;
|
|
3
|
-
export default PdfModule;
|
|
4
|
-
export { PdfModule };
|
|
5
|
-
export { PdfFunctions, PdfFunctionMetadata, PdfModuleMetadata } from "./pdf.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,QAAA,MAAM,SAAS,EAAE,aAMhB,CAAC;AAEF,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PdfFunctions, PdfFunctionMetadata, PdfModuleMetadata } from "./pdf.js";
|
|
2
|
-
const PdfModule = {
|
|
3
|
-
name: "pdf",
|
|
4
|
-
functions: PdfFunctions,
|
|
5
|
-
functionMetadata: PdfFunctionMetadata,
|
|
6
|
-
moduleMetadata: PdfModuleMetadata,
|
|
7
|
-
global: false,
|
|
8
|
-
}; // as ModuleAdapter
|
|
9
|
-
export default PdfModule;
|
|
10
|
-
export { PdfModule };
|
|
11
|
-
export { PdfFunctions, PdfFunctionMetadata, PdfModuleMetadata } from "./pdf.js";
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEhF,MAAM,SAAS,GAAkB;IAC/B,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,YAAY;IACvB,gBAAgB,EAAE,mBAA0B;IAC5C,cAAc,EAAE,iBAAwB;IACxC,MAAM,EAAE,KAAK;CACd,CAAC,CAAC,mBAAmB;AAEtB,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/pdf.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { BuiltinHandler } from "@wiredwp/robinpath";
|
|
2
|
-
export declare const PdfFunctions: Record<string, BuiltinHandler>;
|
|
3
|
-
export declare const PdfFunctionMetadata: {
|
|
4
|
-
generate: {
|
|
5
|
-
description: string;
|
|
6
|
-
parameters: {
|
|
7
|
-
name: string;
|
|
8
|
-
dataType: string;
|
|
9
|
-
description: string;
|
|
10
|
-
formInputType: string;
|
|
11
|
-
required: boolean;
|
|
12
|
-
}[];
|
|
13
|
-
returnType: string;
|
|
14
|
-
returnDescription: string;
|
|
15
|
-
example: string;
|
|
16
|
-
};
|
|
17
|
-
parse: {
|
|
18
|
-
description: string;
|
|
19
|
-
parameters: {
|
|
20
|
-
name: string;
|
|
21
|
-
dataType: string;
|
|
22
|
-
description: string;
|
|
23
|
-
formInputType: string;
|
|
24
|
-
required: boolean;
|
|
25
|
-
}[];
|
|
26
|
-
returnType: string;
|
|
27
|
-
returnDescription: string;
|
|
28
|
-
example: string;
|
|
29
|
-
};
|
|
30
|
-
extractText: {
|
|
31
|
-
description: string;
|
|
32
|
-
parameters: {
|
|
33
|
-
name: string;
|
|
34
|
-
dataType: string;
|
|
35
|
-
description: string;
|
|
36
|
-
formInputType: string;
|
|
37
|
-
required: boolean;
|
|
38
|
-
}[];
|
|
39
|
-
returnType: string;
|
|
40
|
-
returnDescription: string;
|
|
41
|
-
example: string;
|
|
42
|
-
};
|
|
43
|
-
pageCount: {
|
|
44
|
-
description: string;
|
|
45
|
-
parameters: {
|
|
46
|
-
name: string;
|
|
47
|
-
dataType: string;
|
|
48
|
-
description: string;
|
|
49
|
-
formInputType: string;
|
|
50
|
-
required: boolean;
|
|
51
|
-
}[];
|
|
52
|
-
returnType: string;
|
|
53
|
-
returnDescription: string;
|
|
54
|
-
example: string;
|
|
55
|
-
};
|
|
56
|
-
metadata: {
|
|
57
|
-
description: string;
|
|
58
|
-
parameters: {
|
|
59
|
-
name: string;
|
|
60
|
-
dataType: string;
|
|
61
|
-
description: string;
|
|
62
|
-
formInputType: string;
|
|
63
|
-
required: boolean;
|
|
64
|
-
}[];
|
|
65
|
-
returnType: string;
|
|
66
|
-
returnDescription: string;
|
|
67
|
-
example: string;
|
|
68
|
-
};
|
|
69
|
-
generateTable: {
|
|
70
|
-
description: string;
|
|
71
|
-
parameters: {
|
|
72
|
-
name: string;
|
|
73
|
-
dataType: string;
|
|
74
|
-
description: string;
|
|
75
|
-
formInputType: string;
|
|
76
|
-
required: boolean;
|
|
77
|
-
}[];
|
|
78
|
-
returnType: string;
|
|
79
|
-
returnDescription: string;
|
|
80
|
-
example: string;
|
|
81
|
-
};
|
|
82
|
-
generateFromHtml: {
|
|
83
|
-
description: string;
|
|
84
|
-
parameters: {
|
|
85
|
-
name: string;
|
|
86
|
-
dataType: string;
|
|
87
|
-
description: string;
|
|
88
|
-
formInputType: string;
|
|
89
|
-
required: boolean;
|
|
90
|
-
}[];
|
|
91
|
-
returnType: string;
|
|
92
|
-
returnDescription: string;
|
|
93
|
-
example: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
export declare const PdfModuleMetadata: {
|
|
97
|
-
description: string;
|
|
98
|
-
methods: string[];
|
|
99
|
-
};
|
|
100
|
-
//# sourceMappingURL=pdf.d.ts.map
|
package/dist/pdf.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../src/pdf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA2C,MAAM,oBAAoB,CAAC;AA4KlG,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAEvD,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ/B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC"}
|