node-poppler 9.1.1 → 10.0.0

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.
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfAttachOptions
5
+ * @property {boolean} [printVersionInfo] Print copyright and version info.
6
+ * @property {boolean} [replace] Replace embedded file with same name (if it exists).
7
+ */
8
+
9
+ /** @type {Record<keyof PdfAttachOptions, import("../index").OptionDetails>} */
10
+ module.exports = {
11
+ printVersionInfo: { arg: "-v", type: "boolean" },
12
+ replace: { arg: "-replace", type: "boolean" },
13
+ };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfDetachOptions
5
+ * @property {boolean} [listEmbedded] List all of the embedded files in the PDF file.
6
+ * File names are converted to the text encoding specified by `options.outputEncoding`.
7
+ * @property {string} [outputEncoding] Sets the encoding to use for text output.
8
+ * This defaults to `UTF-8`.
9
+ * @property {string} [ownerPassword] Owner password (for encrypted files).
10
+ * @property {string} [outputPath] Set the file name used when saving an embedded file with
11
+ * the save option enabled, or the directory if `options.saveAllFiles` is used.
12
+ * @property {boolean} [printVersionInfo] Print copyright and version info.
13
+ * @property {boolean} [saveAllFiles] Save all of the embedded files. This uses the file
14
+ * names associated with the embedded files (as printed by `options.listEmbedded`).
15
+ * By default, the files are saved in the current directory; this can be changed
16
+ * with `options.outputPath`.
17
+ * @property {string} [saveFile] Save the specified embedded file.
18
+ * By default, this uses the file name associated with the embedded file (as printed by
19
+ * `options.listEmbedded`); the file name can be changed with `options.outputPath`.
20
+ * @property {number} [saveSpecificFile] Save the specified embedded file.
21
+ * By default, this uses the file name associated with the embedded file (as printed by
22
+ * `options.listEmbedded`); the file name can be changed with `options.outputPath`.
23
+ * @property {string} [userPassword] User password (for encrypted files).
24
+ */
25
+
26
+ /** @type {Record<keyof PdfDetachOptions, import("../index").OptionDetails>} */
27
+ module.exports = {
28
+ listEmbedded: { arg: "-list", type: "boolean" },
29
+ outputEncoding: { arg: "-enc", type: "string" },
30
+ outputPath: { arg: "-o", type: "string" },
31
+ ownerPassword: { arg: "-opw", type: "string" },
32
+ printVersionInfo: { arg: "-v", type: "boolean" },
33
+ saveAllFiles: { arg: "-saveall", type: "boolean" },
34
+ saveFile: {
35
+ arg: "-savefile",
36
+ type: "string",
37
+ minVersion: "0.86.0",
38
+ },
39
+ saveSpecificFile: { arg: "-save", type: "number" },
40
+ userPassword: { arg: "-upw", type: "string" },
41
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfFontsOptions
5
+ * @property {number} [firstPageToExamine] Specifies the first page to examine.
6
+ * @property {number} [lastPageToExamine] Specifies the last page to examine.
7
+ * @property {boolean} [listSubstitutes] List the substitute fonts that Poppler
8
+ * will use for non-embedded fonts.
9
+ * @property {string} [ownerPassword] Owner password (for encrypted files).
10
+ * @property {boolean} [printVersionInfo] Print copyright and version info.
11
+ * @property {string} [userPassword] User password (for encrypted files).
12
+ */
13
+
14
+ /** @type {Record<keyof PdfFontsOptions, import("../index").OptionDetails>} */
15
+ module.exports = {
16
+ firstPageToExamine: { arg: "-f", type: "number" },
17
+ lastPageToExamine: { arg: "-l", type: "number" },
18
+ listSubstitutes: { arg: "-subst", type: "boolean", minVersion: "0.19.0" },
19
+ ownerPassword: { arg: "-opw", type: "string" },
20
+ printVersionInfo: { arg: "-v", type: "boolean" },
21
+ userPassword: { arg: "-upw", type: "string" },
22
+ };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfImagesOptions
5
+ * @property {boolean} [allFiles] Write JPEG, JPEG2000, JBIG2, and CCITT images in their native format.
6
+ * CMYK files are written as TIFF files. All other images are written as PNG files.
7
+ * @property {boolean} [ccittFile] Generate CCITT images as CCITT files.
8
+ * @property {number} [firstPageToConvert] Specifies the first page to convert.
9
+ * @property {number} [lastPageToConvert] Specifies the last page to convert.
10
+ * @property {boolean} [jbig2File] Generate JBIG2 images as JBIG2 files.
11
+ * @property {boolean} [jpeg2000File] Generate JPEG2000 images as JP2 files.
12
+ * @property {boolean} [jpegFile] Generate JPEG images as JPEG files.
13
+ * @property {boolean} [list] Instead of writing the images, list the
14
+ * images along with various information for each image.
15
+ * NOTE: Do not specify the `outputPrefix` with this option.
16
+ * @property {boolean} [outputPageNumbers] Include page numbers in output file names.
17
+ * @property {string} [ownerPassword] Owner password (for encrypted files).
18
+ * @property {boolean} [pngFile] Change the default output format to PNG.
19
+ * @property {boolean} [printFilenames] Print image filenames to stdout.
20
+ * @property {boolean} [printVersionInfo] Print copyright and version info.
21
+ * @property {boolean} [quiet] Do not print any messages or errors.
22
+ * @property {boolean} [tiffFile] Change the default output format to TIFF.
23
+ * @property {string} [userPassword] Specify the user password for the PDF file.
24
+ */
25
+
26
+ /** @type {Record<keyof PdfImagesOptions, import("../index").OptionDetails>} */
27
+ module.exports = {
28
+ allFiles: { arg: "-all", type: "boolean" },
29
+ ccittFile: { arg: "-ccitt", type: "boolean" },
30
+ firstPageToConvert: { arg: "-f", type: "number" },
31
+ lastPageToConvert: { arg: "-l", type: "number" },
32
+ jbig2File: { arg: "-jbig2", type: "boolean" },
33
+ jpeg2000File: { arg: "-jp2", type: "boolean" },
34
+ jpegFile: { arg: "-j", type: "boolean" },
35
+ list: { arg: "-list", type: "boolean", minVersion: "0.19.0" },
36
+ outputPageNumbers: { arg: "-p", type: "boolean", minVersion: "0.15.2" },
37
+ ownerPassword: { arg: "-opw", type: "string" },
38
+ pngFile: { arg: "-png", type: "boolean" },
39
+ printFilenames: {
40
+ arg: "-print-filenames",
41
+ type: "boolean",
42
+ minVersion: "24.03.0",
43
+ },
44
+ printVersionInfo: { arg: "-v", type: "boolean" },
45
+ quiet: { arg: "-q", type: "boolean" },
46
+ tiffFile: { arg: "-tiff", type: "boolean", minVersion: "0.53.0" },
47
+ userPassword: { arg: "-upw", type: "string" },
48
+ };
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfInfoOptions
5
+ * @property {number} [firstPageToConvert] First page to print.
6
+ * @property {number} [lastPageToConvert] Last page to print.
7
+ * @property {boolean} [listEncodingOptions] List the available encodings.
8
+ * @property {string} [outputEncoding] Sets the encoding to use for text output.
9
+ * This defaults to `'UTF-8'`.
10
+ * @property {string} [ownerPassword] Owner password (for encrypted files).
11
+ * @property {boolean} [printAsJson] Print result as a JSON object.
12
+ * @property {boolean} [printBoundingBoxes] Prints the page box bounding boxes:
13
+ * MediaBox, CropBox, BleedBox, TrimBox, and ArtBox.
14
+ * @property {boolean} [printCustomMetadata] Print both custom and standard metadata.
15
+ * @property {boolean} [printDocStruct] Prints the logical document structure
16
+ * of a Tagged-PDF file.
17
+ * @property {boolean} [printDocStructText] Print the textual content along with the
18
+ * document structure of a Tagged-PDF file. Note that extracting text this way might be slow
19
+ * for big PDF files.
20
+ * @property {boolean} [printIsoDates] Prints dates in ISO-8601 format (including the time zone).
21
+ * @property {boolean} [printJS] Prints all JavaScript in the PDF file.
22
+ * @property {boolean} [printMetadata] Prints document-level metadata. (This is the `Metadata`
23
+ * stream from the PDF file's Catalog object).
24
+ * @property {boolean} [printNamedDests] Print a list of all named destinations. If a page range
25
+ * is specified using the `options.firstPageToConvert` and `options.lastPageToConvert` options, only destinations
26
+ * in the page range are listed.
27
+ * @property {boolean} [printRawDates] Prints the raw (undecoded) date strings, directly from the PDF file.
28
+ * @property {boolean} [printUrls] Print all URLs in the PDF; only URLs referenced by PDF objects
29
+ * such as Link Annotations are listed, not URL strings in the text content.
30
+ * @property {boolean} [printVersionInfo] Print copyright and version info.
31
+ * @property {string} [userPassword] User password (for encrypted files).
32
+ */
33
+
34
+ /** @type {Record<keyof PdfInfoOptions, import("../index").OptionDetails>} */
35
+ module.exports = {
36
+ firstPageToConvert: { arg: "-f", type: "number" },
37
+ lastPageToConvert: { arg: "-l", type: "number" },
38
+ listEncodingOptions: {
39
+ arg: "-listenc",
40
+ type: "boolean",
41
+ minVersion: "0.9.0",
42
+ },
43
+ outputEncoding: { arg: "-enc", type: "string" },
44
+ ownerPassword: { arg: "-opw", type: "string" },
45
+ printAsJson: { arg: "", type: "boolean" },
46
+ printBoundingBoxes: { arg: "-box", type: "boolean" },
47
+ printCustomMetadata: {
48
+ arg: "-custom",
49
+ type: "boolean",
50
+ minVersion: "21.10.0",
51
+ },
52
+ printDocStruct: { arg: "-struct", type: "boolean" },
53
+ printDocStructText: {
54
+ arg: "-struct-text",
55
+ type: "boolean",
56
+ },
57
+ printIsoDates: { arg: "-isodates", type: "boolean", minVersion: "0.45.0" },
58
+ printJS: { arg: "-js", type: "boolean", minVersion: "0.25.0" },
59
+ printMetadata: { arg: "-meta", type: "boolean" },
60
+ printNamedDests: { arg: "-dests", type: "boolean", minVersion: "0.58.0" },
61
+ printRawDates: { arg: "-rawdates", type: "boolean" },
62
+ printUrls: { arg: "-url", type: "boolean", minVersion: "21.11.0" },
63
+ printVersionInfo: { arg: "-v", type: "boolean" },
64
+ userPassword: { arg: "-upw", type: "string" },
65
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfSeparateOptions
5
+ * @property {number} [firstPageToExtract] Specifies the first page to extract.
6
+ * This defaults to page 1.
7
+ * @property {number} [lastPageToExtract] Specifies the last page to extract.
8
+ * This defaults to the last page of the PDF file.
9
+ * @property {boolean} [printVersionInfo] Print copyright and version info.
10
+ */
11
+
12
+ /** @type {Record<keyof PdfSeparateOptions, import("../index").OptionDetails>} */
13
+ module.exports = {
14
+ firstPageToExtract: { arg: "-f", type: "number", minVersion: "0.18.0" },
15
+ lastPageToExtract: { arg: "-l", type: "number", minVersion: "0.18.0" },
16
+ printVersionInfo: { arg: "-v", type: "boolean", minVersion: "0.18.0" },
17
+ };
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfToCairoOptions
5
+ * @property {('best'|'default'|'fast'|'good'|'gray'|'none'|'subpixel')} [antialias] Set the cairo
6
+ * antialias option used for text and drawing in image files (or rasterized regions in vector output).
7
+ * @property {boolean} [cropBox] Uses the crop box rather than media box when
8
+ * generating the files (PNG/JPEG/TIFF only).
9
+ * @property {number} [cropHeight] Specifies the height of crop area in pixels
10
+ * (image output) or points (vector output).
11
+ * @property {number} [cropSize] Specifies the size of crop square in pixels
12
+ * (image output) or points (vector output).
13
+ * @property {number} [cropWidth] Specifies the width of crop area in pixels
14
+ * (image output) or points (vector output).
15
+ * @property {number} [cropXAxis] Specifies the x-coordinate of the crop area top left
16
+ * corner in pixels (image output) or points (vector output).
17
+ * @property {number} [cropYAxis] Specifies the y-coordinate of the crop area top left
18
+ * corner in pixels (image output) or points (vector output).
19
+ * @property {boolean} [duplex] Adds the %%IncludeFeature: *Duplex DuplexNoTumble DSC
20
+ * comment to the PostScript file (PS only). This tells the print manager to enable duplexing.
21
+ * @property {boolean} [epsFile] Generate an EPS file. An EPS file contains a single image,
22
+ * so if you use this option with a multi-page PDF file, you must use `options.firstPageToConvert` and
23
+ * `options.lastPageToConvert` to specify a single page.
24
+ * The page size options (originalPageSizes, paperSize, paperWidth, paperHeight) can not be used
25
+ * with this option.
26
+ * @property {boolean} [evenPagesOnly] Generates only the even numbered pages.
27
+ * @property {boolean} [fillPage] Expand PDF pages smaller than the paper to fill the
28
+ * paper (PS,PDF,SVG only). By default, these pages are not scaled.
29
+ * @property {number} [firstPageToConvert] Specifies the first page to convert.
30
+ * @property {boolean} [grayscaleFile] Generate grayscale file (PNG, JPEG, and TIFF only).
31
+ * @property {string} [iccFile] Use the specified ICC file as the output profile
32
+ * (PNG only). The profile will be embedded in the PNG file.
33
+ * @property {boolean} [jpegFile] Generate JPEG file(s).
34
+ * @property {string} [jpegOptions] When used with `options.jpegFile`, this option can
35
+ * be used to control the JPEG compression parameters. It takes a string of the form
36
+ * `"<opt>=<val>[,<opt>=<val>]"`. Currently available options are:
37
+ * - `quality` Selects the JPEG quality value. The value must be an integer between 0 and 100
38
+ * - `progressive` Select progressive JPEG output. The possible values are `"y"`, `"n"`, indicating
39
+ * progressive (yes) or non-progressive (no), respectively
40
+ * - `optimize` Sets whether to compute optimal Huffman coding tables for the JPEG output, which
41
+ * will create smaller files but make an extra pass over the data. The value must be `"y"` or `"n"`,
42
+ * with `"y"` performing optimization, otherwise the default Huffman tables are used
43
+ *
44
+ * Example: `"quality=95,optimize=y"`.
45
+ * @property {number} [lastPageToConvert] Specifies the last page to convert.
46
+ * @property {boolean} [monochromeFile] Generate monochrome file (PNG and TIFF only).
47
+ * @property {boolean} [noCenter] By default, PDF pages smaller than the paper
48
+ * (after any scaling) are centered on the paper. This option causes them to be aligned to
49
+ * the lower-left corner of the paper instead (PS, PDF, and SVG only).
50
+ * @property {boolean} [noCrop] By default, printing output is cropped to the CropBox
51
+ * specified in the PDF file. This option disables cropping (PS, PDF, and SVG only).
52
+ * @property {boolean} [noShrink] Do not scale PDF pages which are larger than the paper
53
+ * (PS, PDF, SVG only). By default, pages larger than the paper are shrunk to fit.
54
+ * @property {boolean} [oddPagesOnly] Generates only the odd numbered pages.
55
+ * @property {boolean} [originalPageSizes] Set the paper size of each page to match
56
+ * the size specified in the PDF file.
57
+ * @property {string} [ownerPassword] Specify the owner password for the PDF file.
58
+ * Providing this will bypass all security restrictions.
59
+ * @property {number} [paperHeight] Set the paper height, in points (PS, PDF, and SVG only).
60
+ * @property {('A3'|'A4'|'legal'|'letter'|'match')} [paperSize] Set the paper size to one of `'A3'`, `'A4'`,
61
+ * `'legal'`, or `'letter'` (PS, PDF, and SVG only). This can also be set to `'match'`, which will set the
62
+ * paper size of each page to match the size specified in the PDF file. If none of `options.paperSize`,
63
+ * `options.paperWidth`, or `options.paperHeight` is specified the default is to match the paper size.
64
+ * @property {number} [paperWidth] Set the paper width, in points (PS, PDF, and SVG only).
65
+ * @property {boolean} [pdfFile] Generate PDF file.
66
+ * @property {boolean} [pngFile] Generate PNG file(s).
67
+ * @property {boolean} [printVersionInfo] Print copyright and version information.
68
+ * @property {boolean} [printDocStruct] If the input file contains structural information
69
+ * about the document's content, write this information to the output file (PDF only).
70
+ * @property {boolean} [psFile] Generate PS file.
71
+ * @property {boolean} [psLevel2] Generate Level 2 PostScript (PS only).
72
+ * @property {boolean} [psLevel3] Generate Level 3 PostScript (PS only). This enables all
73
+ * Level 2 features plus shading patterns and masked images. This is the default setting.
74
+ * @property {boolean} [quiet] Do not print any messages or errors.
75
+ * @property {number} [resolutionXAxis] Specifies the X resolution, in pixels per inch of
76
+ * image files (or rasterized regions in vector output). The default is `150` PPI.
77
+ * @property {number} [resolutionXYAxis] Specifies the X and Y resolution, in pixels per
78
+ * inch of image files (or rasterized regions in vector output). The default is `150` PPI.
79
+ * @property {number} [resolutionYAxis] Specifies the Y resolution, in pixels per inch of
80
+ * image files (or rasterized regions in vector output). The default is `150` PPI.
81
+ * @property {number} [scalePageTo] Scales the long side of each page (width for landscape
82
+ * pages, height for portrait pages) to fit in scale-to pixels. The size of the short side will
83
+ * be determined by the aspect ratio of the page (PNG/JPEG/TIFF only).
84
+ * @property {number} [scalePageToXAxis] Scales each page horizontally to fit in scale-to-x
85
+ * pixels. If scale-to-y is set to `-1`, the vertical size will be determined by the aspect ratio of
86
+ * the page (PNG/JPEG/TIFF only).
87
+ * @property {number} [scalePageToYAxis] Scales each page vertically to fit in scale-to-y
88
+ * pixels. If scale-to-x is set to `-1`, the horizontal size will be determined by the aspect ratio of
89
+ * the page (PNG/JPEG/TIFF only).
90
+ * @property {boolean} [singleFile] Writes only the first page and does not add digits.
91
+ * Can only be used with `options.jpegFile`, `options.pngFile`, and `options.tiffFile`.
92
+ * @property {boolean} [svgFile] Generate SVG (Scalable Vector Graphics) file.
93
+ * @property {('deflate'|'jpeg'|'lzw'|'none'|'packbits')} [tiffCompression] Set TIFF compression.
94
+ * @property {boolean} [tiffFile] Generate TIFF file(s).
95
+ * @property {boolean} [transparentPageColor] Use a transparent page color
96
+ * instead of white (PNG and TIFF only).
97
+ * @property {string} [userPassword] Specify the user password for the PDF file.
98
+ */
99
+
100
+ /** @type {Record<keyof PdfToCairoOptions, import("../index").OptionDetails>} */
101
+ module.exports = {
102
+ antialias: { arg: "-antialias", type: "string", minVersion: "0.44.0" },
103
+ cropBox: { arg: "-cropbox", type: "boolean", minVersion: "0.17.3" },
104
+ cropHeight: { arg: "-H", type: "number", minVersion: "0.17.3" },
105
+ cropSize: { arg: "-sz", type: "number", minVersion: "0.17.3" },
106
+ cropWidth: { arg: "-W", type: "number", minVersion: "0.17.3" },
107
+ cropXAxis: { arg: "-x", type: "number", minVersion: "0.17.3" },
108
+ cropYAxis: { arg: "-y", type: "number", minVersion: "0.17.3" },
109
+ duplex: { arg: "-duplex", type: "boolean", minVersion: "0.17.3" },
110
+ epsFile: { arg: "-eps", type: "boolean", minVersion: "0.17.3" },
111
+ evenPagesOnly: { arg: "-e", type: "boolean", minVersion: "0.17.3" },
112
+ fillPage: { arg: "-expand", type: "boolean", minVersion: "0.17.3" },
113
+ firstPageToConvert: { arg: "-f", type: "number", minVersion: "0.17.3" },
114
+ grayscaleFile: { arg: "-gray", type: "boolean", minVersion: "0.17.3" },
115
+ iccFile: { arg: "-icc", type: "string", minVersion: "0.17.3" },
116
+ jpegFile: { arg: "-jpeg", type: "boolean", minVersion: "0.17.3" },
117
+ jpegOptions: { arg: "-jpegopt", type: "string", minVersion: "0.58.0" },
118
+ lastPageToConvert: { arg: "-l", type: "number", minVersion: "0.17.3" },
119
+ monochromeFile: { arg: "-mono", type: "boolean", minVersion: "0.17.3" },
120
+ noCenter: { arg: "-nocenter", type: "boolean", minVersion: "0.17.3" },
121
+ noCrop: { arg: "-nocrop", type: "boolean", minVersion: "0.17.3" },
122
+ noShrink: { arg: "-noshrink", type: "boolean", minVersion: "0.17.3" },
123
+ oddPagesOnly: { arg: "-o", type: "boolean", minVersion: "0.17.3" },
124
+ originalPageSizes: {
125
+ arg: "-origpagesizes",
126
+ type: "boolean",
127
+ minVersion: "0.17.3",
128
+ },
129
+ ownerPassword: { arg: "-opw", type: "string", minVersion: "0.17.3" },
130
+ paperHeight: { arg: "-paperh", type: "number", minVersion: "0.17.3" },
131
+ paperSize: { arg: "-paper", type: "string", minVersion: "0.17.3" },
132
+ paperWidth: { arg: "-paperw", type: "number", minVersion: "0.17.3" },
133
+ pdfFile: { arg: "-pdf", type: "boolean", minVersion: "0.17.3" },
134
+ pngFile: { arg: "-png", type: "boolean", minVersion: "0.17.3" },
135
+ printDocStruct: { arg: "-struct", type: "boolean", minVersion: "23.11.0" },
136
+ printVersionInfo: { arg: "-v", type: "boolean", minVersion: "0.17.3" },
137
+ psFile: { arg: "-ps", type: "boolean", minVersion: "0.17.3" },
138
+ psLevel2: { arg: "-level2", type: "boolean", minVersion: "0.17.3" },
139
+ psLevel3: { arg: "-level3", type: "boolean", minVersion: "0.17.3" },
140
+ quiet: { arg: "-q", type: "boolean", minVersion: "0.17.3" },
141
+ resolutionXAxis: { arg: "-rx", type: "number", minVersion: "0.17.3" },
142
+ resolutionXYAxis: { arg: "-r", type: "number", minVersion: "0.17.3" },
143
+ resolutionYAxis: { arg: "-ry", type: "number", minVersion: "0.17.3" },
144
+ scalePageTo: { arg: "-scale-to", type: "number", minVersion: "0.17.3" },
145
+ scalePageToXAxis: {
146
+ arg: "-scale-to-x",
147
+ type: "number",
148
+ minVersion: "0.17.3",
149
+ },
150
+ scalePageToYAxis: {
151
+ arg: "-scale-to-y",
152
+ type: "number",
153
+ minVersion: "0.17.3",
154
+ },
155
+ singleFile: { arg: "-singlefile", type: "boolean", minVersion: "0.17.3" },
156
+ svgFile: { arg: "-svg", type: "boolean", minVersion: "0.17.3" },
157
+ tiffCompression: {
158
+ arg: "-tiffcompression",
159
+ type: "string",
160
+ minVersion: "0.21.2",
161
+ },
162
+ tiffFile: { arg: "-tiff", type: "boolean", minVersion: "0.21.2" },
163
+ transparentPageColor: {
164
+ arg: "-transp",
165
+ type: "boolean",
166
+ minVersion: "0.17.3",
167
+ },
168
+ userPassword: { arg: "-upw", type: "string", minVersion: "0.17.3" },
169
+ };
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfToHtmlOptions
5
+ * @property {boolean} [complexOutput] Generate complex output.
6
+ * @property {boolean} [dataUrls] Use data URLs instead of external images in HTML.
7
+ * @property {boolean} [exchangePdfLinks] Exchange .pdf links with .html.
8
+ * @property {boolean} [extractHidden] Force hidden text extraction.
9
+ * @property {number} [firstPageToConvert] First page to print.
10
+ * @property {boolean} [fontFullName] Outputs the font name without any substitutions.
11
+ * @property {boolean} [ignoreImages] Ignore images.
12
+ * @property {('JPG'|'PNG')} [imageFormat] Image file format for Splash output (JPG or PNG).
13
+ * If `options.complexOutput` is enabled, but `options.imageFormat` is not specified, PNG will be assumed.
14
+ * @property {number} [lastPageToConvert] Last page to print.
15
+ * @property {boolean} [noDrm] Override document DRM settings.
16
+ * @property {boolean} [noFrames] Generate no frames. Not supported in complex output mode.
17
+ * @property {boolean} [noMergeParagraph] Do not merge paragraphs.
18
+ * @property {boolean} [noRoundedCoordinates] Do not round coordinates
19
+ * (with XML output only).
20
+ * @property {string} [outputEncoding] Sets the encoding to use for text output.
21
+ * This defaults to `'UTF-8'`.
22
+ * @property {string} [ownerPassword] Owner password (for encrypted files).
23
+ * @property {boolean} [printVersionInfo] Print copyright and version info.
24
+ * @property {boolean} [quiet] Do not print any messages or errors.
25
+ * @property {boolean} [singlePage] Generate single HTML that includes all pages.
26
+ * @property {boolean} [stdout] Use standard output.
27
+ * @property {string} [userPassword] User password (for encrypted files).
28
+ * @property {number} [wordBreakThreshold] Adjust the word break threshold percent.
29
+ * Default is `10`. Word break occurs when distance between two adjacent characters is greater
30
+ * than this percent of character height.
31
+ * @property {boolean} [xmlOutput] Output for XML post-processing.
32
+ * @property {number} [zoom] Zoom the PDF document (default `1.5`).
33
+ */
34
+
35
+ /** @type {Record<keyof PdfToHtmlOptions, import("../index").OptionDetails>} */
36
+ module.exports = {
37
+ complexOutput: { arg: "-c", type: "boolean" },
38
+ dataUrls: { arg: "-dataurls", type: "boolean", minVersion: "0.75.0" },
39
+ exchangePdfLinks: { arg: "-p", type: "boolean" },
40
+ extractHidden: { arg: "-hidden", type: "boolean" },
41
+ firstPageToConvert: { arg: "-f", type: "number" },
42
+ fontFullName: {
43
+ arg: "-fontfullname",
44
+ type: "boolean",
45
+ minVersion: "0.21.0",
46
+ },
47
+ ignoreImages: { arg: "-i", type: "boolean" },
48
+ imageFormat: { arg: "-fmt", type: "string" },
49
+ lastPageToConvert: { arg: "-l", type: "number" },
50
+ noDrm: { arg: "-nodrm", type: "boolean" },
51
+ noFrames: { arg: "-noframes", type: "boolean" },
52
+ noMergeParagraph: {
53
+ arg: "-nomerge",
54
+ type: "boolean",
55
+ },
56
+ noRoundedCoordinates: {
57
+ arg: "-noroundcoord",
58
+ type: "boolean",
59
+ minVersion: "0.68.0",
60
+ },
61
+ outputEncoding: { arg: "-enc", type: "string" },
62
+ ownerPassword: { arg: "-opw", type: "string" },
63
+ printVersionInfo: { arg: "-v", type: "boolean" },
64
+ quiet: { arg: "-q", type: "boolean" },
65
+ singlePage: { arg: "-s", type: "boolean", minVersion: "0.15.1" },
66
+ stdout: { arg: "-stdout", type: "boolean" },
67
+ userPassword: { arg: "-upw", type: "string" },
68
+ wordBreakThreshold: { arg: "-wbt", type: "number" },
69
+ xmlOutput: { arg: "-xml", type: "boolean" },
70
+ zoom: { arg: "-zoom", type: "number" },
71
+ };
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @typedef PdfToPpmOptions
5
+ * @property {('no'|'yes')} [antialiasFonts] Enable or disable font anti-aliasing.
6
+ * This defaults to `'yes'`.
7
+ * @property {('no'|'yes')} [antialiasVectors] Enable or disable vector anti-aliasing.
8
+ * This defaults to `'yes'`.
9
+ * @property {boolean} [cropBox] Uses the crop box rather than media box when
10
+ * generating the files (PNG/JPEG/TIFF only).
11
+ * @property {number} [cropHeight] Specifies the height of crop area in pixels
12
+ * (image output) or points (vector output).
13
+ * @property {number} [cropSize] Specifies the size of crop square in pixels
14
+ * (image output) or points (vector output).
15
+ * @property {number} [cropWidth] Specifies the width of crop area in pixels
16
+ * (image output) or points (vector output).
17
+ * @property {number} [cropXAxis] Specifies the x-coordinate of the crop area top left
18
+ * corner in pixels (image output) or points (vector output).
19
+ * @property {number} [cropYAxis] Specifies the y-coordinate of the crop area top left
20
+ * corner in pixels (image output) or points (vector output).
21
+ * @property {string} [defaultCmykProfile] If Poppler is compiled with colour management support, this option
22
+ * sets the DefaultCMYK color space to the ICC profile stored in the display profile file passed.
23
+ * @property {string} [defaultGrayProfile] If Poppler is compiled with colour management support, this option
24
+ * sets the DefaultGray color space to the ICC profile stored in the display profile file passed.
25
+ * @property {string} [defaultRgbProfile] If Poppler is compiled with colour management support, this option
26
+ * sets the DefaultRGB color space to the ICC profile stored in the display profile file passed.
27
+ * @property {string} [displayProfile] If Poppler is compiled with colour management support, this option
28
+ * sets the display profile to the ICC profile stored in the display profile file passed.
29
+ * @property {boolean} [evenPagesOnly] Generates only the even numbered pages.
30
+ * @property {number} [firstPageToConvert] Specifies the first page to convert.
31
+ * @property {('no'|'yes')} [freetype] Enable or disable FreeType (a TrueType / Type 1 font rasterizer).
32
+ * This defaults to `'yes'`.
33
+ * @property {boolean} [forcePageNumber] Force page number even if there is only one page.
34
+ * @property {boolean} [grayscaleFile] Generate grayscale PGM file (instead of a color PPM file).
35
+ * @property {boolean} [hideAnnotations] Hide annotations.
36
+ * @property {boolean} [jpegCmyk] Generate a CMYK JPEG file.
37
+ * @property {boolean} [jpegFile] Generate JPEG file instead of a PPM file.
38
+ * @property {string} [jpegOptions] When used with `options.jpegFile`, this option can
39
+ * be used to control the JPEG compression parameters. It takes a string of the form
40
+ * `"<opt>=<val>[,<opt>=<val>]"`. Currently available options are:
41
+ * - `quality` Selects the JPEG quality value. The value must be an integer between 0 and 100
42
+ * - `progressive` Select progressive JPEG output. The possible values are `"y"`, `"n"`, indicating
43
+ * progressive (yes) or non-progressive (no), respectively
44
+ * @property {number} [lastPageToConvert] Specifies the last page to convert.
45
+ * @property {boolean} [monochromeFile] Generate monochrome PBM file (instead of a color PPM file).
46
+ * @property {boolean} [oddPagesOnly] Generates only the odd numbered pages.
47
+ * @property {string} [ownerPassword] Specify the owner password for the PDF file.
48
+ * Providing this will bypass all security restrictions.
49
+ * @property {boolean} [overprint] Enable overprint emulation during rasterization.
50
+ * @property {boolean} [pngFile] Generate PNG file instead of a PPM file.
51
+ * @property {boolean} [printProgress] Print progress info as each page is generated.
52
+ * Three space-separated fields are printed to STDERR: the number of the current page, the number
53
+ * of the last page that will be generated, and the path to the file written to.
54
+ * @property {boolean} [printVersionInfo] Print copyright and version information.
55
+ * @property {boolean} [quiet] Do not print any messages or errors.
56
+ * @property {number} [resolutionXAxis] Specifies the X resolution, in pixels per inch of
57
+ * image files (or rasterized regions in vector output). The default is `150` PPI.
58
+ * @property {number} [resolutionXYAxis] Specifies the X and Y resolution, in pixels per
59
+ * inch of image files (or rasterized regions in vector output). The default is `150` PPI.
60
+ * @property {number} [resolutionYAxis] Specifies the Y resolution, in pixels per inch of
61
+ * image files (or rasterized regions in vector output). The default is `150` PPI.
62
+ * @property {boolean} [scaleDimensionBeforeRotation] Swaps horizontal and vertical size for
63
+ * a rotated (landscape) PDF before scaling instead of after.
64
+ * @property {number} [scalePageTo] Scales the long side of each page (width for landscape
65
+ * pages, height for portrait pages) to fit in scale-to pixels. The size of the short side will
66
+ * be determined by the aspect ratio of the page.
67
+ * @property {number} [scalePageToXAxis] Scales each page horizontally to fit in scale-to-x
68
+ * pixels. If scale-to-y is set to `-1`, the vertical size will be determined by the aspect ratio of
69
+ * the page.
70
+ * @property {number} [scalePageToYAxis] Scales each page vertically to fit in scale-to-y
71
+ * pixels. If scale-to-x is set to `-1`, the horizontal size will be determined by the aspect ratio of
72
+ * the page.
73
+ * @property {string} [separator] Specify single character separator between name and page number.
74
+ * @property {boolean} [singleFile] Writes only the first page and does not add digits.
75
+ * @property {('none'|'shape'|'solid')} [thinLineMode] Specifies the thin line mode. This defaults to `'none'`.
76
+ * @property {('deflate'|'jpeg'|'lzw'|'none'|'packbits')} [tiffCompression] Set TIFF compression.
77
+ * @property {boolean} [tiffFile] Generate TIFF file instead of a PPM file.
78
+ * @property {string} [userPassword] Specify the user password for the PDF file.
79
+ */
80
+
81
+ /** @type {Record<keyof PdfToPpmOptions, import("../index").OptionDetails>} */
82
+ module.exports = {
83
+ antialiasFonts: { arg: "-aa", type: "string" },
84
+ antialiasVectors: {
85
+ arg: "-aaVector",
86
+ type: "string",
87
+ },
88
+ cropBox: { arg: "-cropbox", type: "boolean", minVersion: "0.11.0" },
89
+ cropHeight: { arg: "-H", type: "number" },
90
+ cropSize: { arg: "-sz", type: "number" },
91
+ cropWidth: { arg: "-W", type: "number" },
92
+ cropXAxis: { arg: "-x", type: "number" },
93
+ cropYAxis: { arg: "-y", type: "number" },
94
+ defaultCmykProfile: {
95
+ arg: "-defaultcmykprofile",
96
+ type: "string",
97
+ minVersion: "21.01.0",
98
+ },
99
+ defaultGrayProfile: {
100
+ arg: "-defaultgrayprofile",
101
+ type: "string",
102
+ minVersion: "21.01.0",
103
+ },
104
+ defaultRgbProfile: {
105
+ arg: "-defaultrgbprofile",
106
+ type: "string",
107
+ minVersion: "21.01.0",
108
+ },
109
+ displayProfile: {
110
+ arg: "-displayprofile",
111
+ type: "string",
112
+ minVersion: "0.90.0",
113
+ },
114
+ evenPagesOnly: { arg: "-e", type: "boolean", minVersion: "0.13.3" },
115
+ firstPageToConvert: { arg: "-f", type: "number" },
116
+ forcePageNumber: {
117
+ arg: "-forcenum",
118
+ type: "boolean",
119
+ minVersion: "0.75.0",
120
+ },
121
+ freetype: { arg: "-freetype", type: "string" },
122
+ grayscaleFile: { arg: "-gray", type: "boolean" },
123
+ hideAnnotations: {
124
+ arg: "-hide-annotations",
125
+ type: "boolean",
126
+ minVersion: "0.84.0",
127
+ },
128
+ jpegCmyk: { arg: "-jpegcmyk", type: "boolean" },
129
+ jpegFile: { arg: "-jpeg", type: "boolean", minVersion: "0.13.0" },
130
+ jpegOptions: { arg: "-jpegopt", type: "string", minVersion: "0.58.0" },
131
+ lastPageToConvert: { arg: "-l", type: "number" },
132
+ monochromeFile: { arg: "-mono", type: "boolean" },
133
+ oddPagesOnly: { arg: "-o", type: "boolean", minVersion: "0.13.3" },
134
+ overprint: { arg: "-overprint", type: "boolean" },
135
+ ownerPassword: { arg: "-opw", type: "string" },
136
+ pngFile: { arg: "-png", type: "boolean", minVersion: "0.11.3" },
137
+ printProgress: { arg: "-progress", type: "boolean", minVersion: "21.03.0" },
138
+ printVersionInfo: { arg: "-v", type: "boolean" },
139
+ quiet: { arg: "-q", type: "boolean" },
140
+ resolutionXAxis: { arg: "-rx", type: "number" },
141
+ resolutionXYAxis: { arg: "-r", type: "number" },
142
+ resolutionYAxis: { arg: "-ry", type: "number" },
143
+ scaleDimensionBeforeRotation: {
144
+ arg: "-scale-dimension-before-rotation",
145
+ type: "boolean",
146
+ minVersion: "0.84.0",
147
+ },
148
+ scalePageTo: { arg: "-scale-to", type: "number" },
149
+ scalePageToXAxis: {
150
+ arg: "-scale-to-x",
151
+ type: "number",
152
+ },
153
+ scalePageToYAxis: {
154
+ arg: "-scale-to-y",
155
+ type: "number",
156
+ },
157
+ separator: { arg: "-sep", type: "string", minVersion: "0.75.0" },
158
+ singleFile: { arg: "-singlefile", type: "boolean", minVersion: "0.17.0" },
159
+ thinLineMode: {
160
+ arg: "-thinlinemode",
161
+ type: "string",
162
+ minVersion: "0.25.0",
163
+ },
164
+ tiffCompression: {
165
+ arg: "-tiffcompression",
166
+ type: "string",
167
+ minVersion: "0.17.0",
168
+ },
169
+ tiffFile: { arg: "-tiff", type: "boolean", minVersion: "0.17.0" },
170
+ userPassword: { arg: "-upw", type: "string" },
171
+ };