node-poppler 6.2.6 → 6.2.7
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/package.json +2 -1
- package/src/index.js +259 -258
- package/types/index.d.ts +560 -266
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Poppler;
|
|
2
2
|
export class Poppler {
|
|
3
3
|
/**
|
|
4
|
-
* @param {string
|
|
4
|
+
* @param {string} [binPath] - Path of poppler-utils binaries.
|
|
5
5
|
*/
|
|
6
6
|
constructor(binPath?: string | undefined);
|
|
7
7
|
popplerPath: string;
|
|
@@ -11,128 +11,193 @@ export class Poppler {
|
|
|
11
11
|
* @param {string} file - Filepath of the PDF file to read.
|
|
12
12
|
* @param {string} fileToAttach - Filepath of the attachment to be embedded into the PDF file.
|
|
13
13
|
* @param {string} outputFile - Filepath of the file to output the results to.
|
|
14
|
-
* @param {object
|
|
15
|
-
* @param {boolean
|
|
16
|
-
* @param {boolean
|
|
14
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
15
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
|
|
16
|
+
* @param {boolean} [options.replace] - Replace embedded file with same name (if it exists).
|
|
17
17
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
18
18
|
*/
|
|
19
19
|
pdfAttach(
|
|
20
20
|
file: string,
|
|
21
21
|
fileToAttach: string,
|
|
22
22
|
outputFile: string,
|
|
23
|
-
options?:
|
|
23
|
+
options?:
|
|
24
|
+
| {
|
|
25
|
+
printVersionInfo?: boolean | undefined;
|
|
26
|
+
replace?: boolean | undefined;
|
|
27
|
+
}
|
|
28
|
+
| undefined
|
|
24
29
|
): Promise<string>;
|
|
25
30
|
/**
|
|
26
31
|
* @author Frazer Smith
|
|
27
32
|
* @description Lists or extracts embedded files (attachments) from a PDF file.
|
|
28
33
|
* @param {string} file - Filepath of the PDF file to read.
|
|
29
|
-
* @param {object
|
|
30
|
-
* @param {boolean
|
|
34
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
35
|
+
* @param {boolean} [options.listEmbedded] - List all of the embedded files in the PDF file.
|
|
31
36
|
* File names are converted to the text encoding specified by `options.outputEncoding`.
|
|
32
|
-
* @param {string
|
|
33
|
-
* @param {string
|
|
37
|
+
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
|
|
38
|
+
* @param {string} [options.outputEncoding] - Sets the encoding to use for text output.
|
|
34
39
|
* This defaults to `UTF-8`.
|
|
35
|
-
* @param {string
|
|
40
|
+
* @param {string} [options.outputPath] - Set the file name used when saving an embedded file with
|
|
36
41
|
* the save option enabled, or the directory if `options.saveall` is used.
|
|
37
|
-
* @param {boolean
|
|
38
|
-
* @param {boolean
|
|
42
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
|
|
43
|
+
* @param {boolean} [options.saveAllFiles] - Save all of the embedded files. This uses the file
|
|
39
44
|
* names associated with the embedded files (as printed by `options.listEmbedded`).
|
|
40
45
|
* By default, the files are saved in the current directory; this can be changed
|
|
41
46
|
* with `options.outputPath`.
|
|
42
|
-
* @param {string
|
|
47
|
+
* @param {string} [options.saveFile] - Save the specified embedded file.
|
|
43
48
|
* By default, this uses the file name associated with the embedded file (as printed by
|
|
44
49
|
* `options.listEmbedded`); the file name can be changed with `options.outputPath`.
|
|
45
|
-
* @param {number
|
|
50
|
+
* @param {number} [options.saveSpecificFile] - Save the specified embedded file.
|
|
46
51
|
* By default, this uses the file name associated with the embedded file (as printed by
|
|
47
52
|
* `options.listEmbedded`); the file name can be changed with `options.outputPath`.
|
|
48
|
-
* @param {string
|
|
53
|
+
* @param {string} [options.userPassword] - User password (for encrypted files).
|
|
49
54
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
50
55
|
*/
|
|
51
|
-
pdfDetach(
|
|
56
|
+
pdfDetach(
|
|
57
|
+
file: string,
|
|
58
|
+
options?:
|
|
59
|
+
| {
|
|
60
|
+
listEmbedded?: boolean | undefined;
|
|
61
|
+
ownerPassword?: string | undefined;
|
|
62
|
+
outputEncoding?: string | undefined;
|
|
63
|
+
outputPath?: string | undefined;
|
|
64
|
+
printVersionInfo?: boolean | undefined;
|
|
65
|
+
saveAllFiles?: boolean | undefined;
|
|
66
|
+
saveFile?: string | undefined;
|
|
67
|
+
saveSpecificFile?: number | undefined;
|
|
68
|
+
userPassword?: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
| undefined
|
|
71
|
+
): Promise<string>;
|
|
52
72
|
/**
|
|
53
73
|
* @author Frazer Smith
|
|
54
74
|
* @description Lists the fonts used in a PDF file along with various information for each font.
|
|
55
|
-
* @param {Buffer|
|
|
56
|
-
* @param {object
|
|
57
|
-
* @param {number
|
|
58
|
-
* @param {number
|
|
59
|
-
* @param {boolean
|
|
75
|
+
* @param {Buffer|string} file - PDF file as Buffer, or filepath of the PDF file to read.
|
|
76
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
77
|
+
* @param {number} [options.firstPageToExamine] - Specifies the first page to examine.
|
|
78
|
+
* @param {number} [options.lastPageToExamine] - Specifies the last page to examine.
|
|
79
|
+
* @param {boolean} [options.listSubstitutes] - List the substitute fonts that poppler
|
|
60
80
|
* will use for non-embedded fonts.
|
|
61
|
-
* @param {string
|
|
62
|
-
* @param {boolean
|
|
63
|
-
* @param {string
|
|
81
|
+
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
|
|
82
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
|
|
83
|
+
* @param {string} [options.userPassword] - User password (for encrypted files). *
|
|
64
84
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
65
85
|
*/
|
|
66
86
|
pdfFonts(
|
|
67
87
|
file: Buffer | string,
|
|
68
|
-
options?:
|
|
88
|
+
options?:
|
|
89
|
+
| {
|
|
90
|
+
firstPageToExamine?: number | undefined;
|
|
91
|
+
lastPageToExamine?: number | undefined;
|
|
92
|
+
listSubstitutes?: boolean | undefined;
|
|
93
|
+
ownerPassword?: string | undefined;
|
|
94
|
+
printVersionInfo?: boolean | undefined;
|
|
95
|
+
userPassword?: string | undefined;
|
|
96
|
+
}
|
|
97
|
+
| undefined
|
|
69
98
|
): Promise<string>;
|
|
70
99
|
/**
|
|
71
100
|
* @author Frazer Smith
|
|
72
101
|
* @description Saves images from a PDF file as PPM, PBM, PNG, TIFF, JPEG, JPEG2000, or JBIG2 files.
|
|
73
|
-
* @param {Buffer|
|
|
74
|
-
* @param {string
|
|
75
|
-
* @param {object
|
|
76
|
-
* @param {boolean
|
|
102
|
+
* @param {Buffer|string} file - PDF file as Buffer, or filepath of the PDF file to read.
|
|
103
|
+
* @param {string} [outputPrefix] - Filename prefix of output files.
|
|
104
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
105
|
+
* @param {boolean} [options.allFiles] - Write JPEG, JPEG2000, JBIG2, and CCITT images in their native format.
|
|
77
106
|
* CMYK files are written as TIFF files. All other images are written as PNG files.
|
|
78
|
-
* @param {boolean
|
|
79
|
-
* @param {number
|
|
80
|
-
* @param {number
|
|
81
|
-
* @param {boolean
|
|
107
|
+
* @param {boolean} [options.ccittFile] - Generate CCITT images as CCITT files.
|
|
108
|
+
* @param {number} [options.firstPageToConvert] - Specifies the first page to convert.
|
|
109
|
+
* @param {number} [options.lastPageToConvert] - Specifies the last page to convert.
|
|
110
|
+
* @param {boolean} [options.list] - Instead of writing the images, list the
|
|
82
111
|
* images along with various information for each image.
|
|
83
112
|
* NOTE: Do not specify the outputPrefix with this option.
|
|
84
|
-
* @param {boolean
|
|
85
|
-
* @param {boolean
|
|
86
|
-
* @param {boolean
|
|
87
|
-
* @param {string
|
|
88
|
-
* @param {boolean
|
|
89
|
-
* @param {boolean
|
|
90
|
-
* @param {boolean
|
|
91
|
-
* @param {string
|
|
113
|
+
* @param {boolean} [options.jbig2File] - Generate JBIG2 images as JBIG2 files.
|
|
114
|
+
* @param {boolean} [options.jpeg2000File] - Generate JPEG2000 images at JP2 files.
|
|
115
|
+
* @param {boolean} [options.jpegFile] - Generate JPEG images as JPEG files.
|
|
116
|
+
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
|
|
117
|
+
* @param {boolean} [options.pngFile] - Change the default output format to PNG.
|
|
118
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
|
|
119
|
+
* @param {boolean} [options.tiffFile] - Change the default output format to TIFF.
|
|
120
|
+
* @param {string} [options.userPassword] - Specify the user password for the PDF file.
|
|
92
121
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
93
122
|
*/
|
|
94
123
|
pdfImages(
|
|
95
124
|
file: Buffer | string,
|
|
96
125
|
outputPrefix?: string | undefined,
|
|
97
|
-
options?:
|
|
126
|
+
options?:
|
|
127
|
+
| {
|
|
128
|
+
allFiles?: boolean | undefined;
|
|
129
|
+
ccittFile?: boolean | undefined;
|
|
130
|
+
firstPageToConvert?: number | undefined;
|
|
131
|
+
lastPageToConvert?: number | undefined;
|
|
132
|
+
list?: boolean | undefined;
|
|
133
|
+
jbig2File?: boolean | undefined;
|
|
134
|
+
jpeg2000File?: boolean | undefined;
|
|
135
|
+
jpegFile?: boolean | undefined;
|
|
136
|
+
ownerPassword?: string | undefined;
|
|
137
|
+
pngFile?: boolean | undefined;
|
|
138
|
+
printVersionInfo?: boolean | undefined;
|
|
139
|
+
tiffFile?: boolean | undefined;
|
|
140
|
+
userPassword?: string | undefined;
|
|
141
|
+
}
|
|
142
|
+
| undefined
|
|
98
143
|
): Promise<string>;
|
|
99
144
|
/**
|
|
100
145
|
* @author Frazer Smith
|
|
101
146
|
* @description Prints the contents of the `Info` dictionary from a PDF file.
|
|
102
|
-
* @param {Buffer|
|
|
103
|
-
* @param {object
|
|
104
|
-
* @param {number
|
|
105
|
-
* @param {number
|
|
106
|
-
* @param {boolean
|
|
107
|
-
* @param {string
|
|
147
|
+
* @param {Buffer|string} file - PDF file as Buffer, or filepath of the PDF file to read.
|
|
148
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
149
|
+
* @param {number} [options.firstPageToConvert] - First page to print.
|
|
150
|
+
* @param {number} [options.lastPageToConvert] - Last page to print.
|
|
151
|
+
* @param {boolean} [options.listEncodingOptions] - List the available encodings.
|
|
152
|
+
* @param {string} [options.outputEncoding] - Sets the encoding to use for text output.
|
|
108
153
|
* This defaults to `UTF-8`.
|
|
109
|
-
* @param {string
|
|
110
|
-
* @param {boolean
|
|
111
|
-
* @param {boolean
|
|
154
|
+
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
|
|
155
|
+
* @param {boolean} [options.printAsJson] - Print result as a JSON object.
|
|
156
|
+
* @param {boolean} [options.printBoundingBoxes] - Prints the page box bounding boxes:
|
|
112
157
|
* MediaBox, CropBox, BleedBox, TrimBox, and ArtBox.
|
|
113
|
-
* @param {boolean
|
|
158
|
+
* @param {boolean} [options.printDocStruct] - Prints the logical document structure
|
|
114
159
|
* of a Tagged-PDF file.
|
|
115
|
-
* @param {boolean
|
|
160
|
+
* @param {boolean} [options.printDocStructText] - Print the textual content along with the
|
|
116
161
|
* document structure of a Tagged-PDF file. Note that extracting text this way might be slow
|
|
117
162
|
*
|
|
118
163
|
* for big PDF files.
|
|
119
|
-
* @param {boolean
|
|
120
|
-
* @param {boolean
|
|
121
|
-
* @param {boolean
|
|
164
|
+
* @param {boolean} [options.printIsoDates] - Prints dates in ISO-8601 format (including the time zone).
|
|
165
|
+
* @param {boolean} [options.printJS] - Prints all JavaScript in the PDF file.
|
|
166
|
+
* @param {boolean} [options.printMetadata] - Prints document-level metadata. (This is the `Metadata`
|
|
122
167
|
* stream from the PDF file's Catalog object).
|
|
123
|
-
* @param {boolean
|
|
168
|
+
* @param {boolean} [options.printNamedDests] - Print a list of all named destinations. If a page range
|
|
124
169
|
* is specified using the `options.firstPageToConvert` and `options.lastPageToConvert` options, only destinations
|
|
125
170
|
* in the page range are listed.
|
|
126
|
-
* @param {boolean
|
|
127
|
-
* @param {boolean
|
|
171
|
+
* @param {boolean} [options.printRawDates] - Prints the raw (undecoded) date strings, directly from the PDF file.
|
|
172
|
+
* @param {boolean} [options.printUrls] - Print all URLs in the PDF; only URLs referenced by PDF objects
|
|
128
173
|
* such as Link Annotations are listed, not URL strings in the text content.
|
|
129
|
-
* @param {boolean
|
|
130
|
-
* @param {string
|
|
174
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
|
|
175
|
+
* @param {string} [options.userPassword] - User password (for encrypted files).
|
|
131
176
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
132
177
|
*/
|
|
133
178
|
pdfInfo(
|
|
134
179
|
file: Buffer | string,
|
|
135
|
-
options?:
|
|
180
|
+
options?:
|
|
181
|
+
| {
|
|
182
|
+
firstPageToConvert?: number | undefined;
|
|
183
|
+
lastPageToConvert?: number | undefined;
|
|
184
|
+
listEncodingOptions?: boolean | undefined;
|
|
185
|
+
outputEncoding?: string | undefined;
|
|
186
|
+
ownerPassword?: string | undefined;
|
|
187
|
+
printAsJson?: boolean | undefined;
|
|
188
|
+
printBoundingBoxes?: boolean | undefined;
|
|
189
|
+
printDocStruct?: boolean | undefined;
|
|
190
|
+
printDocStructText?: boolean | undefined;
|
|
191
|
+
printIsoDates?: boolean | undefined;
|
|
192
|
+
printJS?: boolean | undefined;
|
|
193
|
+
printMetadata?: boolean | undefined;
|
|
194
|
+
printNamedDests?: boolean | undefined;
|
|
195
|
+
printRawDates?: boolean | undefined;
|
|
196
|
+
printUrls?: boolean | undefined;
|
|
197
|
+
printVersionInfo?: boolean | undefined;
|
|
198
|
+
userPassword?: string | undefined;
|
|
199
|
+
}
|
|
200
|
+
| undefined
|
|
136
201
|
): Promise<string>;
|
|
137
202
|
/**
|
|
138
203
|
* @author Frazer Smith
|
|
@@ -143,61 +208,67 @@ export class Poppler {
|
|
|
143
208
|
* @param {string} outputPattern - Should contain %d (or any variant respecting printf format),
|
|
144
209
|
* since %d is replaced by the page number.
|
|
145
210
|
* As an example, `sample-%d.pdf` will produce `sample-1.pdf` for a single page document.
|
|
146
|
-
* @param {object
|
|
147
|
-
* @param {number
|
|
211
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
212
|
+
* @param {number} [options.firstPageToExtract] - Specifies the first page to extract.
|
|
148
213
|
* This defaults to page 1.
|
|
149
|
-
* @param {number
|
|
214
|
+
* @param {number} [options.lastPageToExtract] - Specifies the last page to extract.
|
|
150
215
|
* This defaults to the last page of the PDF file.
|
|
151
|
-
* @param {boolean
|
|
216
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
|
|
152
217
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
153
218
|
*/
|
|
154
219
|
pdfSeparate(
|
|
155
220
|
file: string,
|
|
156
221
|
outputPattern: string,
|
|
157
|
-
options?:
|
|
222
|
+
options?:
|
|
223
|
+
| {
|
|
224
|
+
firstPageToExtract?: number | undefined;
|
|
225
|
+
lastPageToExtract?: number | undefined;
|
|
226
|
+
printVersionInfo?: boolean | undefined;
|
|
227
|
+
}
|
|
228
|
+
| undefined
|
|
158
229
|
): Promise<string>;
|
|
159
230
|
/**
|
|
160
231
|
* @author Frazer Smith
|
|
161
232
|
* @description Converts a PDF file to EPS/JPEG/PDF/PNG/PS/SVG/TIFF.
|
|
162
|
-
* @param {Buffer|
|
|
163
|
-
* @param {string
|
|
233
|
+
* @param {Buffer|string} file - PDF file as Buffer, or filepath of the PDF file to read.
|
|
234
|
+
* @param {string} [outputFile] - Filepath of the file to output the results to.
|
|
164
235
|
*
|
|
165
236
|
* If `undefined` then will write output to stdout. Using stdout is not valid with image formats
|
|
166
237
|
* (jpeg, png, and tiff) unless `options.singleFile` is set to `true`.
|
|
167
238
|
* Encoding is set to `binary` if used with `options.singleFile` or `options.pdfFile`.
|
|
168
239
|
*
|
|
169
240
|
* If not set then the output filename will be derived from the PDF file name.
|
|
170
|
-
* @param {object
|
|
171
|
-
* @param {('
|
|
241
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
242
|
+
* @param {('best'|'default'|'fast'|'good'|'gray'|'none'|'subpixel')} [options.antialias] - Set the cairo
|
|
172
243
|
* antialias option used for text and drawing in image files (or rasterized regions in vector output).
|
|
173
|
-
* @param {boolean
|
|
244
|
+
* @param {boolean} [options.cropBox] - Uses the crop box rather than media box when
|
|
174
245
|
* generating the files (PNG/JPEG/TIFF only).
|
|
175
|
-
* @param {number
|
|
246
|
+
* @param {number} [options.cropHeight] - Specifies the height of crop area in pixels
|
|
176
247
|
* (image output) or points (vector output).
|
|
177
|
-
* @param {number
|
|
248
|
+
* @param {number} [options.cropSize] - Specifies the size of crop square in pixels
|
|
178
249
|
* (image output) or points (vector output).
|
|
179
|
-
* @param {number
|
|
250
|
+
* @param {number} [options.cropWidth] - Specifies the width of crop area in pixels
|
|
180
251
|
* (image output) or points (vector output).
|
|
181
|
-
* @param {number
|
|
252
|
+
* @param {number} [options.cropXAxis] - Specifies the x-coordinate of the crop area top left
|
|
182
253
|
* corner in pixels (image output) or points (vector output).
|
|
183
|
-
* @param {number
|
|
254
|
+
* @param {number} [options.cropYAxis] - Specifies the y-coordinate of the crop area top left
|
|
184
255
|
* corner in pixels (image output) or points (vector output).
|
|
185
|
-
* @param {boolean
|
|
256
|
+
* @param {boolean} [options.duplex] - Adds the %%IncludeFeature: *Duplex DuplexNoTumble DSC
|
|
186
257
|
* comment to the PostScript file (PS only). This tells the print manager to enable duplexing.
|
|
187
|
-
* @param {boolean
|
|
258
|
+
* @param {boolean} [options.epsFile] - Generate an EPS file. An EPS file contains a single image,
|
|
188
259
|
* so if you use this option with a multi-page PDF file, you must use `options.firstPageToConvert` and
|
|
189
260
|
* `options.lastPageToConvert` to specify a single page.
|
|
190
261
|
* The page size options (originalPageSizes, paperSize, paperWidth, paperHeight) can not be used
|
|
191
262
|
* with this option.
|
|
192
|
-
* @param {boolean
|
|
193
|
-
* @param {boolean
|
|
263
|
+
* @param {boolean} [options.evenPagesOnly] - Generates only the even numbered pages.
|
|
264
|
+
* @param {boolean} [options.fillPage] - Expand PDF pages smaller than the paper to fill the
|
|
194
265
|
* paper (PS,PDF,SVG only). By default, these pages are not scaled.
|
|
195
|
-
* @param {number
|
|
196
|
-
* @param {boolean
|
|
197
|
-
* @param {string
|
|
266
|
+
* @param {number} [options.firstPageToConvert] - Specifies the first page to convert.
|
|
267
|
+
* @param {boolean} [options.grayscaleFile] - Generate grayscale file (PNG, JPEG, and TIFF only).
|
|
268
|
+
* @param {string} [options.iccFile] - Use the specified ICC file as the output profile
|
|
198
269
|
* (PNG only). The profile will be embedded in the PNG file.
|
|
199
|
-
* @param {boolean
|
|
200
|
-
* @param {string
|
|
270
|
+
* @param {boolean} [options.jpegFile] - Generate JPEG file(s).
|
|
271
|
+
* @param {string} [options.jpegOptions] - When used with `options.jpegFile`, this option can
|
|
201
272
|
* be used to control the JPEG compression parameters. It takes a string of the form
|
|
202
273
|
* `"<opt>=<val>[,<opt>=<val>]"`. Currently available options are:
|
|
203
274
|
* - `quality` Selects the JPEG quality value. The value must be an integer between 0 and 100.
|
|
@@ -208,369 +279,592 @@ export class Poppler {
|
|
|
208
279
|
* with "y" performing optimization, otherwise the default Huffman tables are used.
|
|
209
280
|
*
|
|
210
281
|
* Example: `"quality=95,optimize=y"`.
|
|
211
|
-
* @param {number
|
|
212
|
-
* @param {boolean
|
|
213
|
-
* @param {boolean
|
|
282
|
+
* @param {number} [options.lastPageToConvert] - Specifies the last page to convert.
|
|
283
|
+
* @param {boolean} [options.monochromeFile] - Generate monochrome file (PNG and TIFF only).
|
|
284
|
+
* @param {boolean} [options.noCenter] - By default, PDF pages smaller than the paper
|
|
214
285
|
* (after any scaling) are centered on the paper. This option causes them to be aligned to
|
|
215
286
|
* the lower-left corner of the paper instead (PS,PDF,SVG only).
|
|
216
|
-
* @param {boolean
|
|
287
|
+
* @param {boolean} [options.noCrop] - By default, printing output is cropped to the CropBox
|
|
217
288
|
* specified in the PDF file. This option disables cropping (PS, PDF, SVG only).
|
|
218
|
-
* @param {boolean
|
|
289
|
+
* @param {boolean} [options.noShrink] - Do not scale PDF pages which are larger than the paper
|
|
219
290
|
* (PS,PDF,SVG only). By default, pages larger than the paper are shrunk to fit.
|
|
220
|
-
* @param {boolean
|
|
221
|
-
* @param {boolean
|
|
291
|
+
* @param {boolean} [options.oddPagesOnly] - Generates only the odd numbered pages.
|
|
292
|
+
* @param {boolean} [options.originalPageSizes] - Set the paper size of each page to match
|
|
222
293
|
* the size specified in the PDF file.
|
|
223
|
-
* @param {string
|
|
294
|
+
* @param {string} [options.ownerPassword] - Specify the owner password for the PDF file.
|
|
224
295
|
* Providing this will bypass all security restrictions.
|
|
225
|
-
* @param {number
|
|
226
|
-
* @param {('
|
|
227
|
-
* or `
|
|
296
|
+
* @param {number} [options.paperHeight] - Set the paper height, in points (PS, PDF, SVG only).
|
|
297
|
+
* @param {('A3'|'A4'|'legal'|'letter'|'match')} [options.paperSize] - Set the paper size to one of `A3`, `A4`,
|
|
298
|
+
* `legal`, or `letter` (PS,PDF,SVG only). This can also be set to `match`, which will set the paper size
|
|
228
299
|
* of each page to match the size specified in the PDF file. If none of the paperSize,
|
|
229
300
|
* paperWidth, or paperHeight options are specified the default is to match the paper size.
|
|
230
|
-
* @param {number
|
|
231
|
-
* @param {boolean
|
|
232
|
-
* @param {boolean
|
|
233
|
-
* @param {boolean
|
|
234
|
-
* @param {boolean
|
|
235
|
-
* @param {boolean
|
|
236
|
-
* @param {boolean
|
|
301
|
+
* @param {number} [options.paperWidth] - Set the paper width, in points (PS,PDF,SVG only).
|
|
302
|
+
* @param {boolean} [options.pdfFile] - Generate PDF file.
|
|
303
|
+
* @param {boolean} [options.pngFile] - Generate PNG file(s).
|
|
304
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version information.
|
|
305
|
+
* @param {boolean} [options.psFile] - Generate PS file.
|
|
306
|
+
* @param {boolean} [options.psLevel2] - Generate Level 2 PostScript (PS only).
|
|
307
|
+
* @param {boolean} [options.psLevel3] - Generate Level 3 PostScript (PS only). This enables all
|
|
237
308
|
* Level 2 features plus shading patterns and masked images. This is the default setting.
|
|
238
|
-
* @param {boolean
|
|
239
|
-
* @param {number
|
|
309
|
+
* @param {boolean} [options.quiet] - Do not print any messages or errors.
|
|
310
|
+
* @param {number} [options.resolutionXAxis] - Specifies the X resolution, in pixels per inch of
|
|
240
311
|
* image files (or rasterized regions in vector output). The default is 150 PPI.
|
|
241
|
-
* @param {number
|
|
312
|
+
* @param {number} [options.resolutionXYAxis] - Specifies the X and Y resolution, in pixels per
|
|
242
313
|
* inch of image files (or rasterized regions in vector output). The default is 150 PPI.
|
|
243
|
-
* @param {number
|
|
314
|
+
* @param {number} [options.resolutionYAxis] - Specifies the Y resolution, in pixels per inch of
|
|
244
315
|
* image files (or rasterized regions in vector output). The default is 150 PPI.
|
|
245
|
-
* @param {number
|
|
316
|
+
* @param {number} [options.scalePageTo] - Scales the long side of each page (width for landscape
|
|
246
317
|
* pages, height for portrait pages) to fit in scale-to pixels. The size of the short side will
|
|
247
318
|
* be determined by the aspect ratio of the page (PNG/JPEG/TIFF only).
|
|
248
|
-
* @param {number
|
|
319
|
+
* @param {number} [options.scalePageToXAxis] - Scales each page horizontally to fit in scale-to-x
|
|
249
320
|
* pixels. If scale-to-y is set to -1, the vertical size will determined by the aspect ratio of
|
|
250
321
|
* the page (PNG/JPEG/TIFF only).
|
|
251
|
-
* @param {number
|
|
322
|
+
* @param {number} [options.scalePageToYAxis] - Scales each page vertically to fit in scale-to-y
|
|
252
323
|
* pixels. If scale-to-x is set to -1, the horizontal size will determined by the aspect ratio of
|
|
253
324
|
* the page (PNG/JPEG/TIFF only).
|
|
254
|
-
* @param {boolean
|
|
325
|
+
* @param {boolean} [options.singleFile] - Writes only the first page and does not add digits.
|
|
255
326
|
* Can only be used with `options.jpegFile`, `options.pngFile`, and `options.tiffFile`.
|
|
256
|
-
* @param {boolean
|
|
257
|
-
* @param {('
|
|
258
|
-
* @param {boolean
|
|
259
|
-
* @param {boolean
|
|
327
|
+
* @param {boolean} [options.svgFile] - Generate SVG (Scalable Vector Graphics) file.
|
|
328
|
+
* @param {('deflate'|'jpeg'|'lzw'|'none'|'packbits')} [options.tiffCompression] - Set TIFF compression.
|
|
329
|
+
* @param {boolean} [options.tiffFile] - Generate TIFF file(s).
|
|
330
|
+
* @param {boolean} [options.transparentPageColor] - Use a transparent page color
|
|
260
331
|
* instead of white (PNG and TIFF only).
|
|
261
|
-
* @param {string
|
|
332
|
+
* @param {string} [options.userPassword] - Specify the user password for the PDF file.
|
|
262
333
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
263
334
|
*/
|
|
264
335
|
pdfToCairo(
|
|
265
336
|
file: Buffer | string,
|
|
266
337
|
outputFile?: string | undefined,
|
|
267
|
-
options?:
|
|
338
|
+
options?:
|
|
339
|
+
| {
|
|
340
|
+
antialias?:
|
|
341
|
+
| "default"
|
|
342
|
+
| "none"
|
|
343
|
+
| "best"
|
|
344
|
+
| "fast"
|
|
345
|
+
| "good"
|
|
346
|
+
| "gray"
|
|
347
|
+
| "subpixel"
|
|
348
|
+
| undefined;
|
|
349
|
+
cropBox?: boolean | undefined;
|
|
350
|
+
cropHeight?: number | undefined;
|
|
351
|
+
cropSize?: number | undefined;
|
|
352
|
+
cropWidth?: number | undefined;
|
|
353
|
+
cropXAxis?: number | undefined;
|
|
354
|
+
cropYAxis?: number | undefined;
|
|
355
|
+
duplex?: boolean | undefined;
|
|
356
|
+
epsFile?: boolean | undefined;
|
|
357
|
+
evenPagesOnly?: boolean | undefined;
|
|
358
|
+
fillPage?: boolean | undefined;
|
|
359
|
+
firstPageToConvert?: number | undefined;
|
|
360
|
+
grayscaleFile?: boolean | undefined;
|
|
361
|
+
iccFile?: string | undefined;
|
|
362
|
+
jpegFile?: boolean | undefined;
|
|
363
|
+
jpegOptions?: string | undefined;
|
|
364
|
+
lastPageToConvert?: number | undefined;
|
|
365
|
+
monochromeFile?: boolean | undefined;
|
|
366
|
+
noCenter?: boolean | undefined;
|
|
367
|
+
noCrop?: boolean | undefined;
|
|
368
|
+
noShrink?: boolean | undefined;
|
|
369
|
+
oddPagesOnly?: boolean | undefined;
|
|
370
|
+
originalPageSizes?: boolean | undefined;
|
|
371
|
+
ownerPassword?: string | undefined;
|
|
372
|
+
paperHeight?: number | undefined;
|
|
373
|
+
paperSize?:
|
|
374
|
+
| "match"
|
|
375
|
+
| "A3"
|
|
376
|
+
| "A4"
|
|
377
|
+
| "legal"
|
|
378
|
+
| "letter"
|
|
379
|
+
| undefined;
|
|
380
|
+
paperWidth?: number | undefined;
|
|
381
|
+
pdfFile?: boolean | undefined;
|
|
382
|
+
pngFile?: boolean | undefined;
|
|
383
|
+
printVersionInfo?: boolean | undefined;
|
|
384
|
+
psFile?: boolean | undefined;
|
|
385
|
+
psLevel2?: boolean | undefined;
|
|
386
|
+
psLevel3?: boolean | undefined;
|
|
387
|
+
quiet?: boolean | undefined;
|
|
388
|
+
resolutionXAxis?: number | undefined;
|
|
389
|
+
resolutionXYAxis?: number | undefined;
|
|
390
|
+
resolutionYAxis?: number | undefined;
|
|
391
|
+
scalePageTo?: number | undefined;
|
|
392
|
+
scalePageToXAxis?: number | undefined;
|
|
393
|
+
scalePageToYAxis?: number | undefined;
|
|
394
|
+
singleFile?: boolean | undefined;
|
|
395
|
+
svgFile?: boolean | undefined;
|
|
396
|
+
tiffCompression?:
|
|
397
|
+
| "none"
|
|
398
|
+
| "deflate"
|
|
399
|
+
| "jpeg"
|
|
400
|
+
| "lzw"
|
|
401
|
+
| "packbits"
|
|
402
|
+
| undefined;
|
|
403
|
+
tiffFile?: boolean | undefined;
|
|
404
|
+
transparentPageColor?: boolean | undefined;
|
|
405
|
+
userPassword?: string | undefined;
|
|
406
|
+
}
|
|
407
|
+
| undefined
|
|
268
408
|
): Promise<string>;
|
|
269
409
|
/**
|
|
270
410
|
* @author Frazer Smith
|
|
271
411
|
* @description Converts a PDF file to HTML.
|
|
272
|
-
* @param {Buffer|
|
|
273
|
-
* @param {string
|
|
412
|
+
* @param {Buffer|string} file - PDF file as Buffer, or filepath of the PDF file to read.
|
|
413
|
+
* @param {string} [outputFile] - Filepath of the file to output the results to.
|
|
274
414
|
* If `undefined` then Poppler will use the directory and name of the original file
|
|
275
415
|
* and create a new file, with `-html` appended to the end of the filename.
|
|
276
416
|
*
|
|
277
417
|
* Required if `file` is a Buffer.
|
|
278
|
-
* @param {object
|
|
279
|
-
* @param {boolean
|
|
280
|
-
* @param {boolean
|
|
281
|
-
* @param {boolean
|
|
282
|
-
* @param {boolean
|
|
283
|
-
* @param {number
|
|
284
|
-
* @param {boolean
|
|
285
|
-
* @param {boolean
|
|
286
|
-
* @param {('
|
|
418
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
419
|
+
* @param {boolean} [options.complexOutput] - Generate complex output.
|
|
420
|
+
* @param {boolean} [options.dataUrls] - Use data URLs instead of external images in HTML.
|
|
421
|
+
* @param {boolean} [options.exchangePdfLinks] - Exchange .pdf links with .html.
|
|
422
|
+
* @param {boolean} [options.extractHidden] - Force hidden text extraction.
|
|
423
|
+
* @param {number} [options.firstPageToConvert] - First page to print.
|
|
424
|
+
* @param {boolean} [options.fontFullName] - Outputs the font name without any substitutions.
|
|
425
|
+
* @param {boolean} [options.ignoreImages] - Ignore images.
|
|
426
|
+
* @param {('JPG'|'PNG')} [options.imageFormat] - Image file format for Splash output (JPG or PNG).
|
|
287
427
|
* If complexOutput is selected, but imageFormat is not specified, PNG will be assumed.
|
|
288
|
-
* @param {number
|
|
289
|
-
* @param {boolean
|
|
290
|
-
* @param {boolean
|
|
291
|
-
* @param {boolean
|
|
292
|
-
* @param {boolean
|
|
428
|
+
* @param {number} [options.lastPageToConvert] - Last page to print.
|
|
429
|
+
* @param {boolean} [options.noDrm] - Override document DRM settings.
|
|
430
|
+
* @param {boolean} [options.noFrames] - Generate no frames. Not supported in complex output mode.
|
|
431
|
+
* @param {boolean} [options.noMergeParagraph] - Do not merge paragraphs.
|
|
432
|
+
* @param {boolean} [options.noRoundedCoordinates] - Do not round coordinates
|
|
293
433
|
* (with XML output only).
|
|
294
|
-
* @param {string
|
|
434
|
+
* @param {string} [options.outputEncoding] - Sets the encoding to use for text output.
|
|
295
435
|
* This defaults to `UTF-8`.
|
|
296
|
-
* @param {string
|
|
297
|
-
* @param {boolean
|
|
298
|
-
* @param {boolean
|
|
299
|
-
* @param {boolean
|
|
300
|
-
* @param {boolean
|
|
301
|
-
* @param {string
|
|
302
|
-
* @param {number
|
|
436
|
+
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
|
|
437
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
|
|
438
|
+
* @param {boolean} [options.quiet] - Do not print any messages or errors.
|
|
439
|
+
* @param {boolean} [options.singlePage] - generate single HTML that includes all pages.
|
|
440
|
+
* @param {boolean} [options.stdout] - Use standard output.
|
|
441
|
+
* @param {string} [options.userPassword] - User password (for encrypted files).
|
|
442
|
+
* @param {number} [options.wordBreakThreshold] - Adjust the word break threshold percent.
|
|
303
443
|
* Default is 10. Word break occurs when distance between two adjacent characters is greater
|
|
304
444
|
* than this percent of character height.
|
|
305
|
-
* @param {boolean
|
|
306
|
-
* @param {number
|
|
445
|
+
* @param {boolean} [options.xmlOutput] - Output for XML post-processing.
|
|
446
|
+
* @param {number} [options.zoom] - Zoom the PDF document (default 1.5).
|
|
307
447
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
308
448
|
*/
|
|
309
449
|
pdfToHtml(
|
|
310
450
|
file: Buffer | string,
|
|
311
451
|
outputFile?: string | undefined,
|
|
312
|
-
options?:
|
|
452
|
+
options?:
|
|
453
|
+
| {
|
|
454
|
+
complexOutput?: boolean | undefined;
|
|
455
|
+
dataUrls?: boolean | undefined;
|
|
456
|
+
exchangePdfLinks?: boolean | undefined;
|
|
457
|
+
extractHidden?: boolean | undefined;
|
|
458
|
+
firstPageToConvert?: number | undefined;
|
|
459
|
+
fontFullName?: boolean | undefined;
|
|
460
|
+
ignoreImages?: boolean | undefined;
|
|
461
|
+
imageFormat?: "JPG" | "PNG" | undefined;
|
|
462
|
+
lastPageToConvert?: number | undefined;
|
|
463
|
+
noDrm?: boolean | undefined;
|
|
464
|
+
noFrames?: boolean | undefined;
|
|
465
|
+
noMergeParagraph?: boolean | undefined;
|
|
466
|
+
noRoundedCoordinates?: boolean | undefined;
|
|
467
|
+
outputEncoding?: string | undefined;
|
|
468
|
+
ownerPassword?: string | undefined;
|
|
469
|
+
printVersionInfo?: boolean | undefined;
|
|
470
|
+
quiet?: boolean | undefined;
|
|
471
|
+
singlePage?: boolean | undefined;
|
|
472
|
+
stdout?: boolean | undefined;
|
|
473
|
+
userPassword?: string | undefined;
|
|
474
|
+
wordBreakThreshold?: number | undefined;
|
|
475
|
+
xmlOutput?: boolean | undefined;
|
|
476
|
+
zoom?: number | undefined;
|
|
477
|
+
}
|
|
478
|
+
| undefined
|
|
313
479
|
): Promise<string>;
|
|
314
480
|
/**
|
|
315
481
|
* @author Frazer Smith
|
|
316
482
|
* @description Converts a PDF file to colour image files in Portable Pixmap (PPM) format,
|
|
317
483
|
* grayscale image files in Portable Graymap (PGM) format, or monochrome image files
|
|
318
484
|
* in Portable Bitmap (PBM) format.
|
|
319
|
-
* @param {Buffer|
|
|
485
|
+
* @param {Buffer|string} file - PDF file as Buffer, or filepath of the PDF file to read.
|
|
320
486
|
* @param {string} outputPath - Filepath to output the results to.
|
|
321
|
-
* @param {object
|
|
322
|
-
* @param {('
|
|
487
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
488
|
+
* @param {('no'|'yes')} [options.antialiasFonts] - Enable or disable font anti-aliasing.
|
|
323
489
|
* This defaults to `yes`.
|
|
324
|
-
* @param {('
|
|
490
|
+
* @param {('no'|'yes')} [options.antialiasVectors] - Enable or disable vector anti-aliasing.
|
|
325
491
|
* This defaults to `yes`.
|
|
326
|
-
* @param {boolean
|
|
492
|
+
* @param {boolean} [options.cropBox] - Uses the crop box rather than media box when
|
|
327
493
|
* generating the files (PNG/JPEG/TIFF only).
|
|
328
|
-
* @param {number
|
|
494
|
+
* @param {number} [options.cropHeight] - Specifies the height of crop area in pixels
|
|
329
495
|
* (image output) or points (vector output).
|
|
330
|
-
* @param {number
|
|
496
|
+
* @param {number} [options.cropSize] - Specifies the size of crop square in pixels
|
|
331
497
|
* (image output) or points (vector output).
|
|
332
|
-
* @param {number
|
|
498
|
+
* @param {number} [options.cropWidth] - Specifies the width of crop area in pixels
|
|
333
499
|
* (image output) or points (vector output).
|
|
334
|
-
* @param {number
|
|
500
|
+
* @param {number} [options.cropXAxis] - Specifies the x-coordinate of the crop area top left
|
|
335
501
|
* corner in pixels (image output) or points (vector output).
|
|
336
|
-
* @param {number
|
|
502
|
+
* @param {number} [options.cropYAxis] - Specifies the y-coordinate of the crop area top left
|
|
337
503
|
* corner in pixels (image output) or points (vector output).
|
|
338
|
-
* @param {string
|
|
504
|
+
* @param {string} [options.defaultCmykProfile] - If Poppler is compiled with colour management support, this option
|
|
339
505
|
* sets the DefaultCMYK color space to the ICC profile stored in the display profile file passed.
|
|
340
|
-
* @param {string
|
|
506
|
+
* @param {string} [options.defaultGrayProfile] - If Poppler is compiled with colour management support, this option
|
|
341
507
|
* sets the DefaultGray color space to the ICC profile stored in the display profile file passed.
|
|
342
|
-
* @param {string
|
|
508
|
+
* @param {string} [options.defaultRgbProfile] - If Poppler is compiled with colour management support, this option
|
|
343
509
|
* sets the DefaultRGB color space to the ICC profile stored in the display profile file passed.
|
|
344
|
-
* @param {string
|
|
510
|
+
* @param {string} [options.displayProfile] - If Poppler is compiled with colour management support, this option
|
|
345
511
|
* sets the display profile to the ICC profile stored in the display profile file passed.
|
|
346
|
-
* @param {boolean
|
|
347
|
-
* @param {number
|
|
348
|
-
* @param {('
|
|
512
|
+
* @param {boolean} [options.evenPagesOnly] - Generates only the even numbered pages.
|
|
513
|
+
* @param {number} [options.firstPageToConvert] - Specifies the first page to convert.
|
|
514
|
+
* @param {('no'|'yes')} [options.freetype] - Enable or disable FreeType (a TrueType / Type 1 font rasterizer).
|
|
349
515
|
* This defaults to `yes`.
|
|
350
|
-
* @param {boolean
|
|
351
|
-
* @param {boolean
|
|
352
|
-
* @param {boolean
|
|
353
|
-
* @param {boolean
|
|
354
|
-
* @param {number
|
|
355
|
-
* @param {boolean
|
|
356
|
-
* @param {boolean
|
|
357
|
-
* @param {string
|
|
516
|
+
* @param {boolean} [options.forcePageNumber] - Force page number even if there is only one page.
|
|
517
|
+
* @param {boolean} [options.grayscaleFile] - Generate grayscale PGM file (instead of a color PPM file).
|
|
518
|
+
* @param {boolean} [options.hideAnnotations] - Hide annotations.
|
|
519
|
+
* @param {boolean} [options.jpegFile] - Generate JPEG file instead a PPM file.
|
|
520
|
+
* @param {number} [options.lastPageToConvert] - Specifies the last page to convert.
|
|
521
|
+
* @param {boolean} [options.monochromeFile] - Generate monochrome PBM file (instead of a color PPM file).
|
|
522
|
+
* @param {boolean} [options.oddPagesOnly] - Generates only the odd numbered pages.
|
|
523
|
+
* @param {string} [options.ownerPassword] - Specify the owner password for the PDF file.
|
|
358
524
|
* Providing this will bypass all security restrictions.
|
|
359
|
-
* @param {boolean
|
|
360
|
-
* @param {boolean
|
|
525
|
+
* @param {boolean} [options.pngFile] - Generate PNG file instead a PPM file.
|
|
526
|
+
* @param {boolean} [options.printProgress] - Print progress info as each page is generated.
|
|
361
527
|
* Three space-separated fields are printed to STDERR: the number of the current page, the number
|
|
362
528
|
* of the last page that will be generated, and the path to the file written to.
|
|
363
|
-
* @param {boolean
|
|
364
|
-
* @param {boolean
|
|
365
|
-
* @param {number
|
|
529
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version information.
|
|
530
|
+
* @param {boolean} [options.quiet] - Do not print any messages or errors.
|
|
531
|
+
* @param {number} [options.resolutionXAxis] - Specifies the X resolution, in pixels per inch of
|
|
366
532
|
* image files (or rasterized regions in vector output). The default is 150 PPI.
|
|
367
|
-
* @param {number
|
|
533
|
+
* @param {number} [options.resolutionXYAxis] - Specifies the X and Y resolution, in pixels per
|
|
368
534
|
* inch of image files (or rasterized regions in vector output). The default is 150 PPI.
|
|
369
|
-
* @param {number
|
|
535
|
+
* @param {number} [options.resolutionYAxis] - Specifies the Y resolution, in pixels per inch of
|
|
370
536
|
* image files (or rasterized regions in vector output). The default is 150 PPI.
|
|
371
|
-
* @param {number
|
|
537
|
+
* @param {number} [options.scalePageTo] - Scales the long side of each page (width for landscape
|
|
372
538
|
* pages, height for portrait pages) to fit in scale-to pixels. The size of the short side will
|
|
373
539
|
* be determined by the aspect ratio of the page.
|
|
374
|
-
* @param {number
|
|
540
|
+
* @param {number} [options.scalePageToXAxis] - Scales each page horizontally to fit in scale-to-x
|
|
375
541
|
* pixels. If scale-to-y is set to -1, the vertical size will determined by the aspect ratio of
|
|
376
542
|
* the page.
|
|
377
|
-
* @param {number
|
|
543
|
+
* @param {number} [options.scalePageToYAxis] - Scales each page vertically to fit in scale-to-y
|
|
378
544
|
* pixels. If scale-to-x is set to -1, the horizontal size will determined by the aspect ratio of
|
|
379
545
|
* the page.
|
|
380
|
-
* @param {string
|
|
381
|
-
* @param {boolean
|
|
382
|
-
* @param {('none'|'
|
|
383
|
-
* @param {('
|
|
384
|
-
* @param {boolean
|
|
385
|
-
* @param {string
|
|
546
|
+
* @param {string} [options.separator] - Specify single character separator between name and page number.
|
|
547
|
+
* @param {boolean} [options.singleFile] - Writes only the first page and does not add digits.
|
|
548
|
+
* @param {('none'|'shape'|'solid')} [options.thinLineMode] - Specifies the thin line mode. This defaults to `none`.
|
|
549
|
+
* @param {('deflate'|'jpeg'|'lzw'|'none'|'packbits')} [options.tiffCompression] - Set TIFF compression.
|
|
550
|
+
* @param {boolean} [options.tiffFile] - Generate TIFF file instead a PPM file.
|
|
551
|
+
* @param {string} [options.userPassword] - Specify the user password for the PDF file.
|
|
386
552
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
387
553
|
*/
|
|
388
554
|
pdfToPpm(
|
|
389
555
|
file: Buffer | string,
|
|
390
556
|
outputPath: string,
|
|
391
|
-
options?:
|
|
557
|
+
options?:
|
|
558
|
+
| {
|
|
559
|
+
antialiasFonts?: "no" | "yes" | undefined;
|
|
560
|
+
antialiasVectors?: "no" | "yes" | undefined;
|
|
561
|
+
cropBox?: boolean | undefined;
|
|
562
|
+
cropHeight?: number | undefined;
|
|
563
|
+
cropSize?: number | undefined;
|
|
564
|
+
cropWidth?: number | undefined;
|
|
565
|
+
cropXAxis?: number | undefined;
|
|
566
|
+
cropYAxis?: number | undefined;
|
|
567
|
+
defaultCmykProfile?: string | undefined;
|
|
568
|
+
defaultGrayProfile?: string | undefined;
|
|
569
|
+
defaultRgbProfile?: string | undefined;
|
|
570
|
+
displayProfile?: string | undefined;
|
|
571
|
+
evenPagesOnly?: boolean | undefined;
|
|
572
|
+
firstPageToConvert?: number | undefined;
|
|
573
|
+
freetype?: "no" | "yes" | undefined;
|
|
574
|
+
forcePageNumber?: boolean | undefined;
|
|
575
|
+
grayscaleFile?: boolean | undefined;
|
|
576
|
+
hideAnnotations?: boolean | undefined;
|
|
577
|
+
jpegFile?: boolean | undefined;
|
|
578
|
+
lastPageToConvert?: number | undefined;
|
|
579
|
+
monochromeFile?: boolean | undefined;
|
|
580
|
+
oddPagesOnly?: boolean | undefined;
|
|
581
|
+
ownerPassword?: string | undefined;
|
|
582
|
+
pngFile?: boolean | undefined;
|
|
583
|
+
printProgress?: boolean | undefined;
|
|
584
|
+
printVersionInfo?: boolean | undefined;
|
|
585
|
+
quiet?: boolean | undefined;
|
|
586
|
+
resolutionXAxis?: number | undefined;
|
|
587
|
+
resolutionXYAxis?: number | undefined;
|
|
588
|
+
resolutionYAxis?: number | undefined;
|
|
589
|
+
scalePageTo?: number | undefined;
|
|
590
|
+
scalePageToXAxis?: number | undefined;
|
|
591
|
+
scalePageToYAxis?: number | undefined;
|
|
592
|
+
separator?: string | undefined;
|
|
593
|
+
singleFile?: boolean | undefined;
|
|
594
|
+
thinLineMode?: "none" | "shape" | "solid" | undefined;
|
|
595
|
+
tiffCompression?:
|
|
596
|
+
| "none"
|
|
597
|
+
| "deflate"
|
|
598
|
+
| "jpeg"
|
|
599
|
+
| "lzw"
|
|
600
|
+
| "packbits"
|
|
601
|
+
| undefined;
|
|
602
|
+
tiffFile?: boolean | undefined;
|
|
603
|
+
userPassword?: string | undefined;
|
|
604
|
+
}
|
|
605
|
+
| undefined
|
|
392
606
|
): Promise<string>;
|
|
393
607
|
/**
|
|
394
608
|
* @author Frazer Smith
|
|
395
609
|
* @description Converts a PDF file to PostScript (PS).
|
|
396
|
-
* @param {Buffer|
|
|
397
|
-
* @param {string
|
|
610
|
+
* @param {Buffer|string} file - PDF file as Buffer, or filepath of the PDF file to read.
|
|
611
|
+
* @param {string} [outputFile] - Filepath of the file to output the results to.
|
|
398
612
|
* If `undefined` then will write output to stdout.
|
|
399
|
-
* @param {object
|
|
400
|
-
* @param {('
|
|
401
|
-
* @param {boolean
|
|
613
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
614
|
+
* @param {('no'|'yes')} [options.antialias] - Enable anti-aliasing on rasterization, accepts `no` or `yes`.
|
|
615
|
+
* @param {boolean} [options.binary] - Write binary data in Level 1 PostScript. By default,
|
|
402
616
|
* pdftops writes hex-encoded data in Level 1 PostScript. Binary data is non-standard in Level 1
|
|
403
617
|
* PostScript but reduces the file size and can be useful when Level 1 PostScript is required
|
|
404
618
|
* only for its restricted use of PostScript operators.
|
|
405
|
-
* @param {string
|
|
619
|
+
* @param {string} [options.defaultCmykProfile] - If Poppler is compiled with colour management support, this option
|
|
406
620
|
* sets the DefaultCMYK color space to the ICC profile stored in the display profile file passed.
|
|
407
|
-
* @param {string
|
|
621
|
+
* @param {string} [options.defaultGrayProfile] - If Poppler is compiled with colour management support, this option
|
|
408
622
|
* sets the DefaultGray color space to the ICC profile stored in the display profile file passed.
|
|
409
|
-
* @param {string
|
|
623
|
+
* @param {string} [options.defaultRgbProfile] - If Poppler is compiled with colour management support, this option
|
|
410
624
|
* sets the DefaultRGB color space to the ICC profile stored in the display profile file passed.
|
|
411
|
-
* @param {boolean
|
|
625
|
+
* @param {boolean} [options.duplex] - Set the Duplex pagedevice entry in the PostScript file.
|
|
412
626
|
* This tells duplex-capable printers to enable duplexing.
|
|
413
|
-
* @param {boolean
|
|
627
|
+
* @param {boolean} [options.epsFile] - Generate an EPS file. An EPS file contains a single image,
|
|
414
628
|
* so if you use this option with a multi-page PDF file, you must use `options.firstPageToConvert` and
|
|
415
629
|
* `options.lastPageToConvert` to specify a single page.
|
|
416
630
|
* The page size options (originalPageSizes, paperSize, paperWidth, paperHeight) can not be used
|
|
417
631
|
* with this option.
|
|
418
|
-
* @param {boolean
|
|
632
|
+
* @param {boolean} [options.fillPage] - Expand PDF pages smaller than the paper to fill the
|
|
419
633
|
* paper. By default, these pages are not scaled.
|
|
420
|
-
* @param {number
|
|
421
|
-
* @param {number
|
|
634
|
+
* @param {number} [options.firstPageToConvert] - Specifies the first page to convert.
|
|
635
|
+
* @param {number} [options.form] - Generate PostScript form which can be imported by software
|
|
422
636
|
* that understands forms.
|
|
423
637
|
* A form contains a single page, so if you use this option with a multi-page PDF file,
|
|
424
638
|
* you must use `options.firstPageToConvert` and `options.lastPageToConvert` to specify a single page.
|
|
425
639
|
* The `options.level1` option cannot be used with `options.form`.
|
|
426
640
|
* No more than one of the mode options (`options.epsFile`, `options.form`) may be given.
|
|
427
|
-
* @param {number
|
|
428
|
-
* @param {boolean
|
|
641
|
+
* @param {number} [options.lastPageToConvert] - Specifies the last page to convert.
|
|
642
|
+
* @param {boolean} [options.level1] - Generate Level 1 PostScript. The resulting PostScript
|
|
429
643
|
* files will be significantly larger (if they contain images), but will print on Level 1 printers.
|
|
430
644
|
* This also converts all images to black and white.
|
|
431
|
-
* @param {boolean
|
|
645
|
+
* @param {boolean} [options.level1Sep] - Generate Level 1 separable PostScript.
|
|
432
646
|
* All colors are converted to CMYK. Images are written with separate stream data for the four components.
|
|
433
|
-
* @param {boolean
|
|
647
|
+
* @param {boolean} [options.level2] - Generate Level 2 PostScript.
|
|
434
648
|
* Level 2 supports color images and image compression. This is the default setting.
|
|
435
|
-
* @param {boolean
|
|
649
|
+
* @param {boolean} [options.level2Sep] - Generate Level 2 separable PostScript. All colors are
|
|
436
650
|
* converted to CMYK. The PostScript separation convention operators are used to handle custom (spot) colors.
|
|
437
|
-
* @param {boolean
|
|
651
|
+
* @param {boolean} [options.level3] - Generate Level 3 PostScript.
|
|
438
652
|
* This enables all Level 2 featuresplus CID font embedding.
|
|
439
|
-
* @param {boolean
|
|
653
|
+
* @param {boolean} [options.level3Sep] - Generate Level 3 separable PostScript.
|
|
440
654
|
* The separation handling is the same as for `options.level2Sep`.
|
|
441
|
-
* @param {boolean
|
|
655
|
+
* @param {boolean} [options.noEmbedCIDFonts] - By default, any CID PostScript fonts which are
|
|
442
656
|
* embedded in the PDF file are copied into the PostScript file. This option disables that embedding.
|
|
443
657
|
* No attempt is made to substitute for non-embedded CID PostScript fonts.
|
|
444
|
-
* @param {boolean
|
|
658
|
+
* @param {boolean} [options.noEmbedCIDTrueTypeFonts] - By default, any CID TrueType fonts which are
|
|
445
659
|
* embedded in the PDF file are copied into the PostScript file. This option disables that embedding.
|
|
446
660
|
* No attempt is made to substitute for non-embedded CID TrueType fonts.
|
|
447
|
-
* @param {boolean
|
|
661
|
+
* @param {boolean} [options.noEmbedTrueTypeFonts] - By default, any TrueType fonts which are embedded
|
|
448
662
|
* in the PDF file are copied into the PostScript file. This option causes pdfToPs to substitute base fonts instead.
|
|
449
663
|
* Embedded fonts make PostScript files larger, but may be necessary for readable output.
|
|
450
664
|
* Also, some PostScript interpreters do not have TrueType rasterizers.
|
|
451
|
-
* @param {boolean
|
|
665
|
+
* @param {boolean} [options.noEmbedType1Fonts] - By default, any Type 1 fonts which are embedded in the PDF file
|
|
452
666
|
* are copied into the PostScript file. This option causes pdfToPs to substitute base fonts instead.
|
|
453
667
|
* Embedded fonts make PostScript files larger, but may be necessary for readable output.
|
|
454
|
-
* @param {boolean
|
|
668
|
+
* @param {boolean} [options.noCenter] - By default, PDF pages smaller than the paper
|
|
455
669
|
* (after any scaling) are centered on the paper. This option causes them to be aligned to
|
|
456
670
|
* the lower-left corner of the paper instead.
|
|
457
|
-
* @param {boolean
|
|
671
|
+
* @param {boolean} [options.noCrop] - By default, printing output is cropped to the CropBox
|
|
458
672
|
* specified in the PDF file. This option disables cropping.
|
|
459
|
-
* @param {boolean
|
|
673
|
+
* @param {boolean} [options.noShrink] - Do not scale PDF pages which are larger than the paper.
|
|
460
674
|
* By default, pages larger than the paper are shrunk to fit.
|
|
461
|
-
* @param {boolean
|
|
462
|
-
* @param {boolean
|
|
675
|
+
* @param {boolean} [options.opi] - Generate OPI comments for all images and forms which have OPI information.
|
|
676
|
+
* @param {boolean} [options.optimizecolorspace] - By default, bitmap images in the PDF pass through to the
|
|
463
677
|
* output PostScript in their original color space, which produces predictable results.
|
|
464
678
|
* This option converts RGB and CMYK images into Gray images if every pixel of the image has equal components.
|
|
465
679
|
* This can fix problems when doing color separations of PDFs that contain embedded black and
|
|
466
680
|
* white images encoded as RGB.
|
|
467
|
-
* @param {boolean
|
|
681
|
+
* @param {boolean} [options.originalPageSizes] - Set the paper size of each page to match
|
|
468
682
|
* the size specified in the PDF file.
|
|
469
|
-
* @param {boolean
|
|
470
|
-
* @param {string
|
|
471
|
-
* @param {number
|
|
472
|
-
* @param {('
|
|
473
|
-
* or `
|
|
683
|
+
* @param {boolean} [options.overprint] - Enable overprinting.
|
|
684
|
+
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
|
|
685
|
+
* @param {number} [options.paperHeight] - Set the paper height, in points.
|
|
686
|
+
* @param {('A3'|'A4'|'legal'|'letter'|'match')} [options.paperSize] - Set the paper size to one of `A3`, `A4`,
|
|
687
|
+
* `legal`, or `letter`. This can also be set to `match`, which will set the paper size
|
|
474
688
|
* of each page to match the size specified in the PDF file. If none of the paperSize,
|
|
475
689
|
* paperWidth, or paperHeight options are specified the default is to match the paper size.
|
|
476
|
-
* @param {number
|
|
477
|
-
* @param {boolean
|
|
690
|
+
* @param {number} [options.paperWidth] - Set the paper width, in points.
|
|
691
|
+
* @param {boolean} [options.passfonts] - By default, references to non-embedded 8-bit fonts
|
|
478
692
|
* in the PDF file are substituted with the closest `Helvetica`, `Times-Roman`, or `Courier` font.
|
|
479
693
|
* This option passes references to non-embedded fonts through to the PostScript file.
|
|
480
|
-
* @param {boolean
|
|
481
|
-
* @param {boolean
|
|
482
|
-
* @param {('CMYK8'|'MONO8'|'RGB8')
|
|
694
|
+
* @param {boolean} [options.preload] - Preload images and forms.
|
|
695
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version information.
|
|
696
|
+
* @param {('CMYK8'|'MONO8'|'RGB8')} [options.processColorFormat] - Sets the process color format as it is used
|
|
483
697
|
* during rasterization and transparency reduction.
|
|
484
698
|
*
|
|
485
699
|
* The default depends on the other settings: For `options.level1` the default is MONO8; for `options.level1Sep`,
|
|
486
700
|
* `options.level2Sep`, `options.level3Sep`, or `options.overprint` the default is CMYK8; in all other
|
|
487
701
|
* cases RGB8 is the default.
|
|
488
702
|
* If `option.processColorProfile` is set then `options.processColorFormat` is inferred from the specified ICC profile.
|
|
489
|
-
* @param {string
|
|
703
|
+
* @param {string} [options.processColorProfile] - Sets the ICC profile that is assumed during
|
|
490
704
|
* rasterization and transparency reduction.
|
|
491
|
-
* @param {boolean
|
|
492
|
-
* @param {('always'|'never'|'whenneeded')
|
|
705
|
+
* @param {boolean} [options.quiet] - Do not print any messages or errors.
|
|
706
|
+
* @param {('always'|'never'|'whenneeded')} [options.rasterize] - By default, pdfToPs rasterizes pages as needed,
|
|
493
707
|
* for example, if they contain transparencies. To force rasterization, set `rasterize` to `always`.
|
|
494
708
|
* Use this to eliminate fonts.
|
|
495
709
|
* To prevent rasterization, set `rasterize` to `never`.
|
|
496
710
|
* This may produce files that display incorrectly.
|
|
497
|
-
* @param {number
|
|
711
|
+
* @param {number} [options.resolutionXYAxis] - Specifies the X and Y resolution, in pixels per
|
|
498
712
|
* inch of image files (or rasterized regions in vector output). The default is 300 PPI.
|
|
499
|
-
* @param {string
|
|
713
|
+
* @param {string} [options.userPassword] - User password (for encrypted files).
|
|
500
714
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
501
715
|
*/
|
|
502
716
|
pdfToPs(
|
|
503
717
|
file: Buffer | string,
|
|
504
718
|
outputFile?: string | undefined,
|
|
505
|
-
options?:
|
|
719
|
+
options?:
|
|
720
|
+
| {
|
|
721
|
+
antialias?: "no" | "yes" | undefined;
|
|
722
|
+
binary?: boolean | undefined;
|
|
723
|
+
defaultCmykProfile?: string | undefined;
|
|
724
|
+
defaultGrayProfile?: string | undefined;
|
|
725
|
+
defaultRgbProfile?: string | undefined;
|
|
726
|
+
duplex?: boolean | undefined;
|
|
727
|
+
epsFile?: boolean | undefined;
|
|
728
|
+
fillPage?: boolean | undefined;
|
|
729
|
+
firstPageToConvert?: number | undefined;
|
|
730
|
+
form?: number | undefined;
|
|
731
|
+
lastPageToConvert?: number | undefined;
|
|
732
|
+
level1?: boolean | undefined;
|
|
733
|
+
level1Sep?: boolean | undefined;
|
|
734
|
+
level2?: boolean | undefined;
|
|
735
|
+
level2Sep?: boolean | undefined;
|
|
736
|
+
level3?: boolean | undefined;
|
|
737
|
+
level3Sep?: boolean | undefined;
|
|
738
|
+
noEmbedCIDFonts?: boolean | undefined;
|
|
739
|
+
noEmbedCIDTrueTypeFonts?: boolean | undefined;
|
|
740
|
+
noEmbedTrueTypeFonts?: boolean | undefined;
|
|
741
|
+
noEmbedType1Fonts?: boolean | undefined;
|
|
742
|
+
noCenter?: boolean | undefined;
|
|
743
|
+
noCrop?: boolean | undefined;
|
|
744
|
+
noShrink?: boolean | undefined;
|
|
745
|
+
opi?: boolean | undefined;
|
|
746
|
+
optimizecolorspace?: boolean | undefined;
|
|
747
|
+
originalPageSizes?: boolean | undefined;
|
|
748
|
+
overprint?: boolean | undefined;
|
|
749
|
+
ownerPassword?: string | undefined;
|
|
750
|
+
paperHeight?: number | undefined;
|
|
751
|
+
paperSize?:
|
|
752
|
+
| "match"
|
|
753
|
+
| "A3"
|
|
754
|
+
| "A4"
|
|
755
|
+
| "legal"
|
|
756
|
+
| "letter"
|
|
757
|
+
| undefined;
|
|
758
|
+
paperWidth?: number | undefined;
|
|
759
|
+
passfonts?: boolean | undefined;
|
|
760
|
+
preload?: boolean | undefined;
|
|
761
|
+
printVersionInfo?: boolean | undefined;
|
|
762
|
+
processColorFormat?: "CMYK8" | "MONO8" | "RGB8" | undefined;
|
|
763
|
+
processColorProfile?: string | undefined;
|
|
764
|
+
quiet?: boolean | undefined;
|
|
765
|
+
rasterize?: "always" | "never" | "whenneeded" | undefined;
|
|
766
|
+
resolutionXYAxis?: number | undefined;
|
|
767
|
+
userPassword?: string | undefined;
|
|
768
|
+
}
|
|
769
|
+
| undefined
|
|
506
770
|
): Promise<string>;
|
|
507
771
|
/**
|
|
508
772
|
* @author Frazer Smith
|
|
509
773
|
* @description Converts a PDF file to TXT.
|
|
510
|
-
* @param {Buffer|
|
|
511
|
-
* @param {string
|
|
774
|
+
* @param {Buffer|string} file - PDF file as Buffer, or filepath of the PDF file to read.
|
|
775
|
+
* @param {string} [outputFile] - Filepath of the file to output the results to.
|
|
512
776
|
* If `undefined` then will write output to stdout.
|
|
513
|
-
* @param {object
|
|
514
|
-
* @param {boolean
|
|
777
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
778
|
+
* @param {boolean} [options.boundingBoxXhtml] - Generate an XHTML file containing bounding
|
|
515
779
|
* box information for each word in the file.
|
|
516
|
-
* @param {boolean
|
|
780
|
+
* @param {boolean} [options.boundingBoxXhtmlLayout] - Generate an XHTML file containing
|
|
517
781
|
* bounding box information for each block, line, and word in the file.
|
|
518
|
-
* @param {boolean
|
|
782
|
+
* @param {boolean} [options.cropBox] - Use the crop box rather than the media box with
|
|
519
783
|
* `options.boundingBoxXhtml` and `options.boundingBoxXhtmlLayout`
|
|
520
|
-
* @param {number
|
|
784
|
+
* @param {number} [options.cropHeight] - Specifies the height of crop area in pixels
|
|
521
785
|
* (image output) or points (vector output).
|
|
522
|
-
* @param {number
|
|
786
|
+
* @param {number} [options.cropWidth] - Specifies the width of crop area in pixels
|
|
523
787
|
* (image output) or points (vector output).
|
|
524
|
-
* @param {number
|
|
788
|
+
* @param {number} [options.cropXAxis] - Specifies the x-coordinate of the crop area top left
|
|
525
789
|
* corner in pixels (image output) or points (vector output).
|
|
526
|
-
* @param {number
|
|
790
|
+
* @param {number} [options.cropYAxis] - Specifies the y-coordinate of the crop area top left
|
|
527
791
|
* corner in pixels (image output) or points (vector output).
|
|
528
|
-
* @param {('
|
|
529
|
-
* text output:
|
|
530
|
-
* @param {number
|
|
531
|
-
* @param {number
|
|
792
|
+
* @param {('dos'|'mac'|'unix')} [options.eolConvention] - Sets the end-of-line convention to use for
|
|
793
|
+
* text output: dos; mac; unix.
|
|
794
|
+
* @param {number} [options.firstPageToConvert] - Specifies the first page to convert.
|
|
795
|
+
* @param {number} [options.fixedWidthLayout] - Assume fixed-pitch (or tabular) text, with the
|
|
532
796
|
* specified character width (in points). This forces physical layout mode.
|
|
533
|
-
* @param {boolean
|
|
797
|
+
* @param {boolean} [options.generateHtmlMetaFile] - Generate simple HTML file, including the
|
|
534
798
|
* meta information. This simply wraps the text in `<pre>` and `</pre>` and prepends the meta headers.
|
|
535
|
-
* @param {boolean
|
|
799
|
+
* @param {boolean} [options.generateTsvFile] - Generate a TSV file containing the bounding box
|
|
536
800
|
* information for each block, line, and word in the file.
|
|
537
|
-
* @param {number
|
|
538
|
-
* @param {boolean
|
|
539
|
-
* @param {boolean
|
|
801
|
+
* @param {number} [options.lastPageToConvert] - Specifies the last page to convert.
|
|
802
|
+
* @param {boolean} [options.listEncodingOptions] - List the available encodings.
|
|
803
|
+
* @param {boolean} [options.maintainLayout] - Maintain (as best as possible) the original physical
|
|
540
804
|
* layout of the text. The default is to undo physical layout (columns, hyphenation, etc.) and
|
|
541
805
|
* output the text in reading order.
|
|
542
|
-
* @param {boolean
|
|
543
|
-
* @param {boolean
|
|
806
|
+
* @param {boolean} [options.noDiagonalText] - Discard diagonal text.
|
|
807
|
+
* @param {boolean} [options.noPageBreaks] - Do not insert page breaks (form feed characters)
|
|
544
808
|
* between pages.
|
|
545
|
-
* @param {string
|
|
809
|
+
* @param {string} [options.outputEncoding] - Sets the encoding to use for text output.
|
|
546
810
|
* This defaults to `UTF-8`.
|
|
547
|
-
* @param {string
|
|
548
|
-
* @param {boolean
|
|
549
|
-
* @param {boolean
|
|
550
|
-
* @param {boolean
|
|
811
|
+
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
|
|
812
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version information.
|
|
813
|
+
* @param {boolean} [options.quiet] - Do not print any messages or errors.
|
|
814
|
+
* @param {boolean} [options.rawLayout] - Keep the text in content stream order. This is a
|
|
551
815
|
* hack which often undoes column formatting, etc. Use of raw mode is no longer recommended.
|
|
552
|
-
* @param {string
|
|
816
|
+
* @param {string} [options.userPassword] - User password (for encrypted files).
|
|
553
817
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
554
818
|
*/
|
|
555
819
|
pdfToText(
|
|
556
820
|
file: Buffer | string,
|
|
557
821
|
outputFile?: string | undefined,
|
|
558
|
-
options?:
|
|
822
|
+
options?:
|
|
823
|
+
| {
|
|
824
|
+
boundingBoxXhtml?: boolean | undefined;
|
|
825
|
+
boundingBoxXhtmlLayout?: boolean | undefined;
|
|
826
|
+
cropBox?: boolean | undefined;
|
|
827
|
+
cropHeight?: number | undefined;
|
|
828
|
+
cropWidth?: number | undefined;
|
|
829
|
+
cropXAxis?: number | undefined;
|
|
830
|
+
cropYAxis?: number | undefined;
|
|
831
|
+
eolConvention?: "dos" | "mac" | "unix" | undefined;
|
|
832
|
+
firstPageToConvert?: number | undefined;
|
|
833
|
+
fixedWidthLayout?: number | undefined;
|
|
834
|
+
generateHtmlMetaFile?: boolean | undefined;
|
|
835
|
+
generateTsvFile?: boolean | undefined;
|
|
836
|
+
lastPageToConvert?: number | undefined;
|
|
837
|
+
listEncodingOptions?: boolean | undefined;
|
|
838
|
+
maintainLayout?: boolean | undefined;
|
|
839
|
+
noDiagonalText?: boolean | undefined;
|
|
840
|
+
noPageBreaks?: boolean | undefined;
|
|
841
|
+
outputEncoding?: string | undefined;
|
|
842
|
+
ownerPassword?: string | undefined;
|
|
843
|
+
printVersionInfo?: boolean | undefined;
|
|
844
|
+
quiet?: boolean | undefined;
|
|
845
|
+
rawLayout?: boolean | undefined;
|
|
846
|
+
userPassword?: string | undefined;
|
|
847
|
+
}
|
|
848
|
+
| undefined
|
|
559
849
|
): Promise<string>;
|
|
560
850
|
/**
|
|
561
851
|
* @author Frazer Smith
|
|
562
852
|
* @description Merges several PDF files in order of their occurrence in the files array to
|
|
563
853
|
* one PDF result file.
|
|
564
|
-
* @param {
|
|
854
|
+
* @param {string[]} files - Filepaths of the PDF files to merge.
|
|
565
855
|
* An entire directory of PDF files can be merged like so: `path/to/directory/*.pdf`.
|
|
566
856
|
* @param {string} outputFile - Filepath of the file to output the resulting merged PDF to.
|
|
567
|
-
* @param {object
|
|
568
|
-
* @param {boolean
|
|
857
|
+
* @param {object} [options] - Object containing options to pass to binary.
|
|
858
|
+
* @param {boolean} [options.printVersionInfo] - Print copyright and version information.
|
|
569
859
|
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
|
|
570
860
|
*/
|
|
571
861
|
pdfUnite(
|
|
572
|
-
files:
|
|
862
|
+
files: string[],
|
|
573
863
|
outputFile: string,
|
|
574
|
-
options?:
|
|
864
|
+
options?:
|
|
865
|
+
| {
|
|
866
|
+
printVersionInfo?: boolean | undefined;
|
|
867
|
+
}
|
|
868
|
+
| undefined
|
|
575
869
|
): Promise<string>;
|
|
576
870
|
}
|