pdfdancer-client-typescript 1.0.1 → 1.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.
- package/.github/workflows/ci.yml +37 -0
- package/README.md +61 -65
- package/dist/__tests__/assertions.d.ts +2 -0
- package/dist/__tests__/assertions.d.ts.map +1 -0
- package/dist/__tests__/assertions.js +11 -0
- package/dist/__tests__/assertions.js.map +1 -0
- package/dist/client-v1.d.ts +16 -26
- package/dist/client-v1.d.ts.map +1 -1
- package/dist/client-v1.js +47 -26
- package/dist/client-v1.js.map +1 -1
- package/dist/exceptions.d.ts +0 -3
- package/dist/exceptions.d.ts.map +1 -1
- package/dist/exceptions.js +0 -3
- package/dist/exceptions.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +34 -9
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +71 -14
- package/dist/models.js.map +1 -1
- package/dist/paragraph-builder.d.ts +0 -8
- package/dist/paragraph-builder.d.ts.map +1 -1
- package/dist/paragraph-builder.js +0 -8
- package/dist/paragraph-builder.js.map +1 -1
- package/example.ts +6 -10
- package/fixtures/form-xobject-example.pdf +0 -0
- package/jest.config.js +25 -24
- package/package.json +1 -1
- package/src/__tests__/assertions.ts +12 -0
- package/src/__tests__/client-v1.test.ts +6 -6
- package/src/__tests__/e2e/acroform.test.ts +92 -0
- package/src/__tests__/e2e/form_x_object.test.ts +49 -0
- package/src/__tests__/e2e/image.test.ts +97 -101
- package/src/__tests__/e2e/line.test.ts +115 -127
- package/src/__tests__/e2e/page.test.ts +3 -6
- package/src/__tests__/e2e/paragraph.test.ts +187 -204
- package/src/__tests__/e2e/path.test.ts +12 -16
- package/src/client-v1.ts +676 -638
- package/src/exceptions.ts +27 -30
- package/src/index.ts +1 -0
- package/src/models.ts +436 -355
- package/src/paragraph-builder.ts +0 -8
- package/src/__tests__/e2e/form.test.ts +0 -51
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, staging, develop, development, dev ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, staging, develop, development, dev ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [ 18.x, 20.x, 22.x, 24.x ]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: ${{ matrix.node-version }}
|
|
24
|
+
cache: 'npm'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm ci
|
|
28
|
+
|
|
29
|
+
- name: Run linter
|
|
30
|
+
run: npm run lint
|
|
31
|
+
|
|
32
|
+
- name: Build
|
|
33
|
+
run: npm run build
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: npm run test:unit
|
|
37
|
+
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# PDFDancer TypeScript Client
|
|
2
2
|
|
|
3
|
-
A TypeScript client library for the PDFDancer PDF manipulation API. This client provides a clean, TypeScript interface
|
|
3
|
+
A TypeScript client library for the PDFDancer PDF manipulation API. This client provides a clean, TypeScript interface
|
|
4
|
+
for PDF operations that closely mirrors the Python client structure and functionality.
|
|
4
5
|
|
|
5
6
|
## Features
|
|
6
7
|
|
|
@@ -21,35 +22,32 @@ npm install pdfdancer-client-typescript
|
|
|
21
22
|
## Basic Usage
|
|
22
23
|
|
|
23
24
|
```typescript
|
|
24
|
-
import {
|
|
25
|
+
import {ClientV1, Position, Color, Font} from 'pdfdancer-client-typescript';
|
|
25
26
|
|
|
26
27
|
async function example() {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
// Load PDF data (from file upload, fetch, etc.)
|
|
29
|
+
const pdfData = new Uint8Array(/* your PDF data */);
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
// Create client with authentication token
|
|
32
|
+
const client = await ClientV1.create('your-auth-token', pdfData, undefined, 30000);
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
// Find all paragraphs on page 1
|
|
35
|
+
const paragraphs = await client.findParagraphs(Position.atPage(1));
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
// Add a new paragraph
|
|
38
|
+
const newParagraph = client.paragraphBuilder()
|
|
39
|
+
.fromString('Hello, PDFDancer!', new Color(255, 0, 0))
|
|
40
|
+
.withFont(new Font('Arial', 12))
|
|
41
|
+
.withPosition(Position.atPageCoordinates(1, 100, 200))
|
|
42
|
+
.build();
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
const newParagraph = client.paragraphBuilder()
|
|
41
|
-
.fromString('Hello, PDFDancer!', new Color(255, 0, 0))
|
|
42
|
-
.withFont(new Font('Arial', 12))
|
|
43
|
-
.withPosition(Position.onPageCoordinates(1, 100, 200))
|
|
44
|
-
.build();
|
|
45
|
-
|
|
46
|
-
await client.addParagraph(newParagraph);
|
|
44
|
+
await client.addParagraph(newParagraph);
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
// Get the modified PDF
|
|
47
|
+
const modifiedPdf = await client.getPdfFile();
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
// Save PDF (browser environment)
|
|
50
|
+
await client.savePdf('modified-document.pdf');
|
|
53
51
|
}
|
|
54
52
|
```
|
|
55
53
|
|
|
@@ -58,14 +56,12 @@ async function example() {
|
|
|
58
56
|
### Client Initialization
|
|
59
57
|
|
|
60
58
|
```typescript
|
|
61
|
-
const client =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
const client = await ClientV1.create(
|
|
60
|
+
token, // Authentication token
|
|
61
|
+
pdfData, // PDF data as Uint8Array, File, or ArrayBuffer
|
|
62
|
+
baseUrl, // Optional: API server URL (default: http://localhost:8080)
|
|
63
|
+
readTimeout // Optional: Request timeout in ms (default: 30000)
|
|
66
64
|
);
|
|
67
|
-
|
|
68
|
-
await client.init(); // Required before using the client
|
|
69
65
|
```
|
|
70
66
|
|
|
71
67
|
### Search Operations
|
|
@@ -77,7 +73,7 @@ const objects = await client.find(ObjectType.PARAGRAPH, position);
|
|
|
77
73
|
// Convenience methods for specific object types
|
|
78
74
|
const paragraphs = await client.findParagraphs(position);
|
|
79
75
|
const images = await client.findImages(position);
|
|
80
|
-
const forms = await client.
|
|
76
|
+
const forms = await client.findFormXObjects(position);
|
|
81
77
|
const paths = await client.findPaths(position);
|
|
82
78
|
const textLines = await client.findTextLines(position);
|
|
83
79
|
|
|
@@ -90,10 +86,10 @@ const page = await client.getPage(1); // 1-based index
|
|
|
90
86
|
|
|
91
87
|
```typescript
|
|
92
88
|
// Page-based position
|
|
93
|
-
const pagePosition = Position.
|
|
89
|
+
const pagePosition = Position.atPage(1);
|
|
94
90
|
|
|
95
91
|
// Coordinate-based position
|
|
96
|
-
const coordPosition = Position.
|
|
92
|
+
const coordPosition = Position.atPageCoordinates(1, 100, 200);
|
|
97
93
|
|
|
98
94
|
// Position with movement
|
|
99
95
|
const movedPosition = coordPosition.copy().moveX(50).moveY(30);
|
|
@@ -104,12 +100,12 @@ const movedPosition = coordPosition.copy().moveX(50).moveY(30);
|
|
|
104
100
|
```typescript
|
|
105
101
|
// Add paragraph using builder pattern
|
|
106
102
|
const paragraph = client.paragraphBuilder()
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
.fromString('Your text here')
|
|
104
|
+
.withFont(new Font('Arial', 12))
|
|
105
|
+
.withColor(new Color(0, 0, 0))
|
|
106
|
+
.withPosition(Position.atPageCoordinates(1, 100, 200))
|
|
107
|
+
.withLineSpacing(1.2)
|
|
108
|
+
.build();
|
|
113
109
|
|
|
114
110
|
await client.addParagraph(paragraph);
|
|
115
111
|
|
|
@@ -167,43 +163,46 @@ The client provides specific exception types for different error scenarios:
|
|
|
167
163
|
|
|
168
164
|
```typescript
|
|
169
165
|
import {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
166
|
+
ValidationException,
|
|
167
|
+
HttpClientException,
|
|
168
|
+
SessionException,
|
|
169
|
+
FontNotFoundException,
|
|
170
|
+
PdfDancerException
|
|
175
171
|
} from 'pdfdancer-client-typescript';
|
|
176
172
|
|
|
177
173
|
try {
|
|
178
|
-
|
|
174
|
+
await client.addParagraph(paragraph);
|
|
179
175
|
} catch (error) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
176
|
+
if (error instanceof ValidationException) {
|
|
177
|
+
console.error('Invalid input:', error.message);
|
|
178
|
+
} else if (error instanceof HttpClientException) {
|
|
179
|
+
console.error('API error:', error.message, 'Status:', error.statusCode);
|
|
180
|
+
} else if (error instanceof FontNotFoundException) {
|
|
181
|
+
console.error('Font not found:', error.message);
|
|
182
|
+
} else if (error instanceof SessionException) {
|
|
183
|
+
console.error('Session error:', error.message);
|
|
184
|
+
}
|
|
189
185
|
}
|
|
190
186
|
```
|
|
191
187
|
|
|
192
188
|
## Types and Enums
|
|
193
189
|
|
|
194
190
|
### ObjectType
|
|
191
|
+
|
|
195
192
|
- `IMAGE` - Image objects
|
|
196
|
-
- `
|
|
193
|
+
- `FORM_X_OBJECT` - Form field objects
|
|
197
194
|
- `PATH` - Vector path objects
|
|
198
195
|
- `PARAGRAPH` - Paragraph objects
|
|
199
196
|
- `TEXT_LINE` - Text line objects
|
|
200
197
|
- `PAGE` - Page objects
|
|
201
198
|
|
|
202
199
|
### PositionMode
|
|
200
|
+
|
|
203
201
|
- `INTERSECT` - Objects that intersect with the specified area
|
|
204
202
|
- `CONTAINS` - Objects completely contained within the specified area
|
|
205
203
|
|
|
206
204
|
### ShapeType
|
|
205
|
+
|
|
207
206
|
- `POINT` - Single point coordinate
|
|
208
207
|
- `LINE` - Linear shape between two points
|
|
209
208
|
- `CIRCLE` - Circular area with radius
|
|
@@ -238,19 +237,20 @@ The project includes comprehensive end-to-end tests that mirror the Python clien
|
|
|
238
237
|
1. **Start PDFDancer server** at `http://localhost:8080` (or set `PDFDANCER_BASE_URL`)
|
|
239
238
|
|
|
240
239
|
2. **Set authentication token**:
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
- Environment variable: `export PDFDANCER_TOKEN=your-token`
|
|
241
|
+
- Or place a `jwt-token-*.txt` file in the project root
|
|
243
242
|
|
|
244
243
|
3. **Add test fixtures** in the `fixtures/` directory:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
244
|
+
- `ObviouslyAwesome.pdf` - Main test document
|
|
245
|
+
- `mixed-form-types.pdf` - Document with form fields
|
|
246
|
+
- `basic-paths.pdf` - Document with vector paths
|
|
247
|
+
- `logo-80.png` - Test image file
|
|
248
|
+
- `DancingScript-Regular.ttf` - Test font file
|
|
250
249
|
|
|
251
250
|
4. **Run e2e tests**: `npm run test:e2e`
|
|
252
251
|
|
|
253
252
|
The e2e tests cover:
|
|
253
|
+
|
|
254
254
|
- **Paragraph operations**: Find, add, modify, delete paragraphs with custom fonts
|
|
255
255
|
- **Page operations**: Get pages, delete pages
|
|
256
256
|
- **Text line operations**: Find, modify, move, delete text lines
|
|
@@ -258,10 +258,6 @@ The e2e tests cover:
|
|
|
258
258
|
- **Form operations**: Find and delete form fields
|
|
259
259
|
- **Path operations**: Find, move, delete vector paths
|
|
260
260
|
|
|
261
|
-
## Compatibility
|
|
262
|
-
|
|
263
|
-
This TypeScript client is designed to be functionally equivalent to the PDFDancer Python client, providing the same API patterns and capabilities with TypeScript type safety and modern JavaScript features.
|
|
264
|
-
|
|
265
261
|
## License
|
|
266
262
|
|
|
267
263
|
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../src/__tests__/assertions.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAClB,IAAI,CAON"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expectWithin = expectWithin;
|
|
4
|
+
function expectWithin(actual, expected, tolerance) {
|
|
5
|
+
if (actual === undefined) {
|
|
6
|
+
throw new Error(`Expected a number but got undefined`);
|
|
7
|
+
}
|
|
8
|
+
const diff = Math.abs(actual - expected);
|
|
9
|
+
expect(diff).toBeLessThanOrEqual(tolerance);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=assertions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertions.js","sourceRoot":"","sources":["../../src/__tests__/assertions.ts"],"names":[],"mappings":";;AAAA,oCAWC;AAXD,SAAgB,YAAY,CACxB,MAA0B,EAC1B,QAAgB,EAChB,SAAiB;IAEjB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,IAAI,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/client-v1.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A TypeScript client that closely mirrors the Python Client class structure and functionality.
|
|
5
5
|
* Provides session-based PDF manipulation operations with strict validation.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { Font, FormFieldRef, Image, ObjectRef, ObjectType, Paragraph, Position } from './models';
|
|
8
8
|
import { ParagraphBuilder } from './paragraph-builder';
|
|
9
9
|
/**
|
|
10
10
|
* REST API client for interacting with the PDFDancer PDF manipulation service.
|
|
@@ -30,10 +30,10 @@ export declare class ClientV1 {
|
|
|
30
30
|
* Initialize the client by creating a session.
|
|
31
31
|
* Must be called after constructor before using the client.
|
|
32
32
|
*/
|
|
33
|
-
init
|
|
33
|
+
private init;
|
|
34
|
+
static create(token: string, pdfData: Uint8Array, baseUrl: string, timeout?: number): Promise<ClientV1>;
|
|
34
35
|
/**
|
|
35
36
|
* Process PDF data from various input types with strict validation.
|
|
36
|
-
* Equivalent to readFile() method in Python client.
|
|
37
37
|
*/
|
|
38
38
|
private _processPdfData;
|
|
39
39
|
/**
|
|
@@ -43,12 +43,10 @@ export declare class ClientV1 {
|
|
|
43
43
|
private _extractErrorMessage;
|
|
44
44
|
/**
|
|
45
45
|
* Creates a new PDF processing session by uploading the PDF data.
|
|
46
|
-
* Equivalent to createSession() method in Python client.
|
|
47
46
|
*/
|
|
48
47
|
private _createSession;
|
|
49
48
|
/**
|
|
50
49
|
* Make HTTP request with session headers and error handling.
|
|
51
|
-
* Equivalent to retrieve() method pattern in Python client.
|
|
52
50
|
*/
|
|
53
51
|
private _makeRequest;
|
|
54
52
|
/**
|
|
@@ -59,94 +57,86 @@ export declare class ClientV1 {
|
|
|
59
57
|
find(objectType?: ObjectType, position?: Position): Promise<ObjectRef[]>;
|
|
60
58
|
/**
|
|
61
59
|
* Searches for paragraph objects at the specified position.
|
|
62
|
-
* Equivalent to findParagraphs() in Python client.
|
|
63
60
|
*/
|
|
64
61
|
findParagraphs(position?: Position): Promise<ObjectRef[]>;
|
|
65
62
|
/**
|
|
66
63
|
* Searches for image objects at the specified position.
|
|
67
|
-
* Equivalent to findImages() in Python client.
|
|
68
64
|
*/
|
|
69
65
|
findImages(position?: Position): Promise<ObjectRef[]>;
|
|
70
66
|
/**
|
|
71
|
-
* Searches for form
|
|
72
|
-
* Equivalent to findForms() in Python client.
|
|
67
|
+
* Searches for form X objects at the specified position.
|
|
73
68
|
*/
|
|
74
|
-
|
|
69
|
+
findFormXObjects(position?: Position): Promise<ObjectRef[]>;
|
|
75
70
|
/**
|
|
76
71
|
* Searches for vector path objects at the specified position.
|
|
77
|
-
* Equivalent to findPaths() in Python client.
|
|
78
72
|
*/
|
|
79
73
|
findPaths(position?: Position): Promise<ObjectRef[]>;
|
|
80
74
|
/**
|
|
81
75
|
* Searches for text line objects at the specified position.
|
|
82
|
-
* Equivalent to findTextLines() in Python client.
|
|
83
76
|
*/
|
|
84
77
|
findTextLines(position?: Position): Promise<ObjectRef[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Searches for form fields at the specified position.
|
|
80
|
+
* Returns FormFieldRef objects with name and value properties.
|
|
81
|
+
*/
|
|
82
|
+
findFormFields(position?: Position): Promise<FormFieldRef[]>;
|
|
85
83
|
/**
|
|
86
84
|
* Retrieves references to all pages in the PDF document.
|
|
87
|
-
* Equivalent to getPages() in Python client.
|
|
88
85
|
*/
|
|
89
86
|
getPages(): Promise<ObjectRef[]>;
|
|
90
87
|
/**
|
|
91
88
|
* Retrieves a reference to a specific page by its page index.
|
|
92
|
-
* Equivalent to getPage() in Python client.
|
|
93
89
|
*/
|
|
94
90
|
getPage(pageIndex: number): Promise<ObjectRef | null>;
|
|
95
91
|
/**
|
|
96
92
|
* Deletes a page from the PDF document.
|
|
97
|
-
* Equivalent to deletePage() in Python client.
|
|
98
93
|
*/
|
|
99
94
|
deletePage(pageRef: ObjectRef): Promise<boolean>;
|
|
100
95
|
/**
|
|
101
96
|
* Deletes the specified PDF object from the document.
|
|
102
|
-
* Equivalent to delete() in Python client.
|
|
103
97
|
*/
|
|
104
98
|
delete(objectRef: ObjectRef): Promise<boolean>;
|
|
105
99
|
/**
|
|
106
100
|
* Moves a PDF object to a new position within the document.
|
|
107
|
-
* Equivalent to move() in Python client.
|
|
108
101
|
*/
|
|
109
102
|
move(objectRef: ObjectRef, position: Position): Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Changes the value of a form field.
|
|
105
|
+
*/
|
|
106
|
+
changeFormField(formFieldRef: FormFieldRef, newValue: string): Promise<boolean>;
|
|
110
107
|
/**
|
|
111
108
|
* Adds an image to the PDF document.
|
|
112
|
-
* Equivalent to addImage() methods in Python client.
|
|
113
109
|
*/
|
|
114
110
|
addImage(image: Image, position?: Position): Promise<boolean>;
|
|
115
111
|
/**
|
|
116
112
|
* Adds a paragraph to the PDF document.
|
|
117
|
-
* Equivalent to addParagraph() in Python client with validation.
|
|
118
113
|
*/
|
|
119
114
|
addParagraph(paragraph: Paragraph): Promise<boolean>;
|
|
120
115
|
/**
|
|
121
116
|
* Internal method to add any PDF object.
|
|
122
|
-
* Equivalent to addObject() in Python client.
|
|
123
117
|
*/
|
|
124
118
|
private _addObject;
|
|
125
119
|
/**
|
|
126
120
|
* Modifies a paragraph object or its text content.
|
|
127
|
-
* Equivalent to modifyParagraph() methods in Python client.
|
|
128
121
|
*/
|
|
129
122
|
modifyParagraph(objectRef: ObjectRef, newParagraph: Paragraph | string): Promise<boolean>;
|
|
130
123
|
/**
|
|
131
124
|
* Modifies a text line object.
|
|
132
|
-
* Equivalent to modifyTextLine() in Python client.
|
|
133
125
|
*/
|
|
134
126
|
modifyTextLine(objectRef: ObjectRef, newText: string): Promise<boolean>;
|
|
135
127
|
/**
|
|
136
128
|
* Finds available fonts matching the specified name and size.
|
|
137
|
-
* Equivalent to findFonts() in Python client.
|
|
138
129
|
*/
|
|
139
130
|
findFonts(fontName: string, fontSize: number): Promise<Font[]>;
|
|
140
131
|
/**
|
|
141
132
|
* Registers a custom font for use in PDF operations.
|
|
142
|
-
* Equivalent to registerFont() in Python client.
|
|
143
133
|
*/
|
|
144
134
|
registerFont(ttfFile: Uint8Array | File): Promise<string>;
|
|
145
135
|
/**
|
|
146
136
|
* Downloads the current state of the PDF document with all modifications applied.
|
|
147
|
-
* Equivalent to getPDFFile() in Python client.
|
|
148
137
|
*/
|
|
149
138
|
getPdfFile(): Promise<Uint8Array>;
|
|
139
|
+
getXmlFile(): Promise<String>;
|
|
150
140
|
/**
|
|
151
141
|
* Saves the current PDF to a file (browser environment).
|
|
152
142
|
* Downloads the PDF in the browser.
|
|
@@ -156,13 +146,13 @@ export declare class ClientV1 {
|
|
|
156
146
|
* Parse JSON object data into ObjectRef instance.
|
|
157
147
|
*/
|
|
158
148
|
private _parseObjectRef;
|
|
149
|
+
private _parseFormFieldRef;
|
|
159
150
|
/**
|
|
160
151
|
* Parse JSON position data into Position instance.
|
|
161
152
|
*/
|
|
162
153
|
private _parsePosition;
|
|
163
154
|
/**
|
|
164
155
|
* Creates a new ParagraphBuilder for fluent paragraph construction.
|
|
165
|
-
* Equivalent to paragraphBuilder() in Python client.
|
|
166
156
|
*/
|
|
167
157
|
paragraphBuilder(): ParagraphBuilder;
|
|
168
158
|
}
|
package/dist/client-v1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-v1.d.ts","sourceRoot":"","sources":["../src/client-v1.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,
|
|
1
|
+
{"version":3,"file":"client-v1.d.ts","sourceRoot":"","sources":["../src/client-v1.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAMH,IAAI,EACJ,YAAY,EACZ,KAAK,EAIL,SAAS,EACT,UAAU,EACV,SAAS,EACT,QAAQ,EAGX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAErD;;;;;;;GAOG;AACH,qBAAa,QAAQ;IACjB,OAAO,CAAC,MAAM,CAAS;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