12
12
<dt ><a href =" #map " >map(pdfFile, [options])</a > ⇒ <code >object</code ></dt >
13
13
<dd ><p >Generates a map from a PDF file and saves as YAML.</p >
14
14
</dd >
15
+ <dt ><a href =" #open " >open(fileName)</a > ⇒ <code >PDF</code ></dt >
16
+ <dd ><p >Opens a PDF form.</p >
17
+ </dd >
18
+ <dt ><a href =" #getTemplate " >getTemplate()</a > ⇒ <code >object</code ></dt >
19
+ <dd ><p >Gets the form template.</p >
20
+ </dd >
21
+ <dt ><a href =" #fillForm " >fillForm(filledTemplate)</a ></dt >
22
+ <dd ><p >Fills out a form using <code >filledTemplate</code >.</p >
23
+ </dd >
24
+ <dt ><a href =" #slice " >slice(begin, end)</a > ⇒ <code >PDF</code ></dt >
25
+ <dd ><p >Slice pages from <code >begin</code > (0-based, inclusive) to <code >end</code > (exclusive).</p >
26
+ </dd >
27
+ <dt ><a href =" #append " >append(pdf)</a ></dt >
28
+ <dd ><p >Appends PDF to the current PDF.</p >
29
+ </dd >
30
+ <dt ><a href =" #save " >save(dest, [flatten])</a > ⇒ <code >Promise</code ></dt >
31
+ <dd ><p >Saves the PDF to file.</p >
32
+ </dd >
15
33
</dl >
16
34
17
35
## Typedefs
@@ -38,7 +56,7 @@ Creates a fillable form from a PDF.
38
56
* [ .fill(filler, [ options] )] ( #Form+fill )
39
57
* [ .save(source, dest)] ( #Form+save )
40
58
* [ .slice(begin, end, dest)] ( #Form+slice )
41
- * [ .join(parts, dest )] ( #Form+join )
59
+ * [ .join(dest, parts )] ( #Form+join )
42
60
43
61
<a name =" Form+init " ></a >
44
62
@@ -94,7 +112,7 @@ form.setFormName('banana');
94
112
### form.setSourcePDF(source)
95
113
Change the source PDF name. By default, this is the the ` source ` PDF
96
114
path provided in [ load] ( load ) function. It allows the source PDF to be
97
- changed prior to calling [ slice] ( slice ) or [ save] ( save ) .
115
+ changed prior to calling [ slice] ( # slice) or [ save] ( # save) .
98
116
99
117
** Kind** : instance method of [ <code >Form</code >] ( #Form )
100
118
** Access** : public
@@ -186,16 +204,16 @@ for slicing pages.
186
204
187
205
<a name="Form+join"></a>
188
206
189
- ### form.join(parts, dest )
207
+ ### form.join(dest, parts )
190
208
Join multiple PDF `parts` into a new PDF `dest`.
191
209
192
210
**Kind**: instance method of [<code>Form</code>](#Form)
193
211
**Access**: public
194
212
195
213
| Param | Type | Description |
196
214
| --- | --- | --- |
197
- | parts | <code>Array.<string> </code> | PDF file name parts to join. |
198
- | dest | <code>string</code> | The destination PDF file to write. |
215
+ | dest | <code>PDF </code> | - |
216
+ | parts | <code>Array.< string> </code> | - |
199
217
200
218
<a name="map"></a>
201
219
@@ -211,6 +229,72 @@ Generates a map from a PDF file and saves as YAML.
211
229
| pdfFile | <code>string</code> | | The PDF file containing a form. |
212
230
| [options] | <code>object</code> | <code>{}</code> | Options. |
213
231
232
+ <a name="open"></a>
233
+
234
+ ## open(fileName) ⇒ <code>PDF</code>
235
+ Opens a PDF form.
236
+
237
+ **Kind**: global function
238
+ **Returns**: <code>PDF</code> - A PDF for filling.
239
+
240
+ | Param | Type | Description |
241
+ | --- | --- | --- |
242
+ | fileName | <code>string</code> | The path to the PDF file to open. |
243
+
244
+ <a name="getTemplate"></a>
245
+
246
+ ## getTemplate() ⇒ <code>object</code>
247
+ Gets the form template.
248
+
249
+ **Kind**: global function
250
+ **Returns**: <code>object</code> - A PDF form template.
251
+ <a name="fillForm"></a>
252
+
253
+ ## fillForm(filledTemplate)
254
+ Fills out a form using `filledTemplate`.
255
+
256
+ **Kind**: global function
257
+
258
+ | Param | Type |
259
+ | --- | --- |
260
+ | filledTemplate | <code>object</code> |
261
+
262
+ <a name="slice"></a>
263
+
264
+ ## slice(begin, end) ⇒ <code>PDF</code>
265
+ Slice pages from `begin` (0-based, inclusive) to `end` (exclusive).
266
+
267
+ **Kind**: global function
268
+ **Returns**: <code>PDF</code> - The new PDF.
269
+
270
+ | Param | Type | Description |
271
+ | --- | --- | --- |
272
+ | begin | <code>int</code> | The index of the page to slice from. |
273
+ | end | <code>int</code> | The index of the page to slice to. |
274
+
275
+ <a name="append"></a>
276
+
277
+ ## append(pdf)
278
+ Appends PDF to the current PDF.
279
+
280
+ **Kind**: global function
281
+
282
+ | Param | Type | Description |
283
+ | --- | --- | --- |
284
+ | pdf | <code>PDF</code> | The PDF to append. |
285
+
286
+ <a name="save"></a>
287
+
288
+ ## save(dest, [flatten]) ⇒ <code>Promise</code>
289
+ Saves the PDF to file.
290
+
291
+ **Kind**: global function
292
+
293
+ | Param | Type | Default | Description |
294
+ | --- | --- | --- | --- |
295
+ | dest | <code>str</code> | | The destination file name. |
296
+ | [flatten] | <code>bool</code> | <code>true</code> | Flattens the PDF form before saving. |
297
+
214
298
<a name="HelperFunction"></a>
215
299
216
300
## HelperFunction ⇒ <code>number</code> \| <code>string</code>
0 commit comments