Skip to content

Commit

Permalink
chore: sort options in ascending order
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Feb 23, 2024
1 parent f561a84 commit f0dc8b8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
8 changes: 4 additions & 4 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ Lists or extracts embedded files (attachments) from a PDF file.
| file | <code>string</code> | Filepath of the PDF file to read. |
| [options] | <code>object</code> | Object containing options to pass to binary. |
| [options.listEmbedded] | <code>boolean</code> | List all of the embedded files in the PDF file. File names are converted to the text encoding specified by `options.outputEncoding`. |
| [options.ownerPassword] | <code>string</code> | Owner password (for encrypted files). |
| [options.outputEncoding] | <code>string</code> | Sets the encoding to use for text output. This defaults to `UTF-8`. |
| [options.ownerPassword] | <code>string</code> | Owner password (for encrypted files). |
| [options.outputPath] | <code>string</code> | Set the file name used when saving an embedded file with the save option enabled, or the directory if `options.saveall` is used. |
| [options.printVersionInfo] | <code>boolean</code> | Print copyright and version info. |
| [options.saveAllFiles] | <code>boolean</code> | Save all of the embedded files. This uses the file names associated with the embedded files (as printed by `options.listEmbedded`). By default, the files are saved in the current directory; this can be changed with `options.outputPath`. |
Expand Down Expand Up @@ -105,10 +105,10 @@ Saves images from a PDF file as PPM, PBM, PNG, TIFF, JPEG, JPEG2000, or JBIG2 fi
| [options.ccittFile] | <code>boolean</code> | Generate CCITT images as CCITT files. |
| [options.firstPageToConvert] | <code>number</code> | Specifies the first page to convert. |
| [options.lastPageToConvert] | <code>number</code> | Specifies the last page to convert. |
| [options.list] | <code>boolean</code> | Instead of writing the images, list the images along with various information for each image. NOTE: Do not specify the outputPrefix with this option. |
| [options.jbig2File] | <code>boolean</code> | Generate JBIG2 images as JBIG2 files. |
| [options.jpeg2000File] | <code>boolean</code> | Generate JPEG2000 images at JP2 files. |
| [options.jpegFile] | <code>boolean</code> | Generate JPEG images as JPEG files. |
| [options.list] | <code>boolean</code> | Instead of writing the images, list the images along with various information for each image. NOTE: Do not specify the outputPrefix with this option. |
| [options.ownerPassword] | <code>string</code> | Owner password (for encrypted files). |
| [options.pngFile] | <code>boolean</code> | Change the default output format to PNG. |
| [options.printVersionInfo] | <code>boolean</code> | Print copyright and version info. |
Expand Down Expand Up @@ -354,12 +354,12 @@ Converts a PDF file to PostScript (PS).
| [options.level2Sep] | <code>boolean</code> | Generate Level 2 separable PostScript. All colors are converted to CMYK. The PostScript separation convention operators are used to handle custom (spot) colors. |
| [options.level3] | <code>boolean</code> | Generate Level 3 PostScript. This enables all Level 2 featuresplus CID font embedding. |
| [options.level3Sep] | <code>boolean</code> | Generate Level 3 separable PostScript. The separation handling is the same as for `options.level2Sep`. |
| [options.noCenter] | <code>boolean</code> | By default, PDF pages smaller than the paper (after any scaling) are centered on the paper. This option causes them to be aligned to the lower-left corner of the paper instead. |
| [options.noCrop] | <code>boolean</code> | By default, printing output is cropped to the CropBox specified in the PDF file. This option disables cropping. |
| [options.noEmbedCIDFonts] | <code>boolean</code> | By default, any CID PostScript fonts which are embedded in the PDF file are copied into the PostScript file. This option disables that embedding. No attempt is made to substitute for non-embedded CID PostScript fonts. |
| [options.noEmbedCIDTrueTypeFonts] | <code>boolean</code> | By default, any CID TrueType fonts which are embedded in the PDF file are copied into the PostScript file. This option disables that embedding. No attempt is made to substitute for non-embedded CID TrueType fonts. |
| [options.noEmbedTrueTypeFonts] | <code>boolean</code> | By default, any TrueType fonts which are embedded in the PDF file are copied into the PostScript file. This option causes pdfToPs to substitute base fonts instead. Embedded fonts make PostScript files larger, but may be necessary for readable output. Also, some PostScript interpreters do not have TrueType rasterizers. |
| [options.noEmbedType1Fonts] | <code>boolean</code> | By default, any Type 1 fonts which are embedded in the PDF file are copied into the PostScript file. This option causes pdfToPs to substitute base fonts instead. Embedded fonts make PostScript files larger, but may be necessary for readable output. |
| [options.noCenter] | <code>boolean</code> | By default, PDF pages smaller than the paper (after any scaling) are centered on the paper. This option causes them to be aligned to the lower-left corner of the paper instead. |
| [options.noCrop] | <code>boolean</code> | By default, printing output is cropped to the CropBox specified in the PDF file. This option disables cropping. |
| [options.noShrink] | <code>boolean</code> | Do not scale PDF pages which are larger than the paper. By default, pages larger than the paper are shrunk to fit. |
| [options.opi] | <code>boolean</code> | Generate OPI comments for all images and forms which have OPI information. |
| [options.optimizecolorspace] | <code>boolean</code> | By default, bitmap images in the PDF pass through to the output PostScript in their original color space, which produces predictable results. This option converts RGB and CMYK images into Gray images if every pixel of the image has equal components. This can fix problems when doing color separations of PDFs that contain embedded black and white images encoded as RGB. |
Expand Down
30 changes: 15 additions & 15 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ class Poppler {
* @param {object} [options] - Object containing options to pass to binary.
* @param {boolean} [options.listEmbedded] - List all of the embedded files in the PDF file.
* File names are converted to the text encoding specified by `options.outputEncoding`.
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
* @param {string} [options.outputEncoding] - Sets the encoding to use for text output.
* This defaults to `UTF-8`.
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
* @param {string} [options.outputPath] - Set the file name used when saving an embedded file with
* the save option enabled, or the directory if `options.saveall` is used.
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
Expand All @@ -167,16 +167,16 @@ class Poppler {
async pdfDetach(file, options = {}) {
const acceptedOptions = {
listEmbedded: { arg: "-list", type: "boolean" },
ownerPassword: { arg: "-opw", type: "string" },
outputEncoding: { arg: "-enc", type: "string" },
outputPath: { arg: "-o", type: "string" },
ownerPassword: { arg: "-opw", type: "string" },
printVersionInfo: { arg: "-v", type: "boolean" },
saveAllFiles: { arg: "-saveall", type: "boolean" },
saveFile: {
arg: "-savefile",
type: "string",
minVersion: "0.86.0",
},
saveAllFiles: { arg: "-saveall", type: "boolean" },
saveSpecificFile: { arg: "-save", type: "number" },
userPassword: { arg: "-upw", type: "string" },
};
Expand Down Expand Up @@ -294,12 +294,12 @@ class Poppler {
* @param {boolean} [options.ccittFile] - Generate CCITT images as CCITT files.
* @param {number} [options.firstPageToConvert] - Specifies the first page to convert.
* @param {number} [options.lastPageToConvert] - Specifies the last page to convert.
* @param {boolean} [options.list] - Instead of writing the images, list the
* images along with various information for each image.
* NOTE: Do not specify the outputPrefix with this option.
* @param {boolean} [options.jbig2File] - Generate JBIG2 images as JBIG2 files.
* @param {boolean} [options.jpeg2000File] - Generate JPEG2000 images at JP2 files.
* @param {boolean} [options.jpegFile] - Generate JPEG images as JPEG files.
* @param {boolean} [options.list] - Instead of writing the images, list the
* images along with various information for each image.
* NOTE: Do not specify the outputPrefix with this option.
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
* @param {boolean} [options.pngFile] - Change the default output format to PNG.
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
Expand All @@ -313,10 +313,10 @@ class Poppler {
ccittFile: { arg: "-ccitt", type: "boolean" },
firstPageToConvert: { arg: "-f", type: "number" },
lastPageToConvert: { arg: "-l", type: "number" },
list: { arg: "-list", type: "boolean" },
jbig2File: { arg: "-jbig2", type: "boolean" },
jpeg2000File: { arg: "-jp2", type: "boolean" },
jpegFile: { arg: "-j", type: "boolean" },
list: { arg: "-list", type: "boolean" },
ownerPassword: { arg: "-opw", type: "string" },
pngFile: { arg: "-png", type: "boolean" },
printVersionInfo: { arg: "-v", type: "boolean" },
Expand Down Expand Up @@ -1211,6 +1211,11 @@ class Poppler {
* This enables all Level 2 featuresplus CID font embedding.
* @param {boolean} [options.level3Sep] - Generate Level 3 separable PostScript.
* The separation handling is the same as for `options.level2Sep`.
* @param {boolean} [options.noCenter] - By default, PDF pages smaller than the paper
* (after any scaling) are centered on the paper. This option causes them to be aligned to
* the lower-left corner of the paper instead.
* @param {boolean} [options.noCrop] - By default, printing output is cropped to the CropBox
* specified in the PDF file. This option disables cropping.
* @param {boolean} [options.noEmbedCIDFonts] - By default, any CID PostScript fonts which are
* embedded in the PDF file are copied into the PostScript file. This option disables that embedding.
* No attempt is made to substitute for non-embedded CID PostScript fonts.
Expand All @@ -1224,11 +1229,6 @@ class Poppler {
* @param {boolean} [options.noEmbedType1Fonts] - By default, any Type 1 fonts which are embedded in the PDF file
* are copied into the PostScript file. This option causes pdfToPs to substitute base fonts instead.
* Embedded fonts make PostScript files larger, but may be necessary for readable output.
* @param {boolean} [options.noCenter] - By default, PDF pages smaller than the paper
* (after any scaling) are centered on the paper. This option causes them to be aligned to
* the lower-left corner of the paper instead.
* @param {boolean} [options.noCrop] - By default, printing output is cropped to the CropBox
* specified in the PDF file. This option disables cropping.
* @param {boolean} [options.noShrink] - Do not scale PDF pages which are larger than the paper.
* By default, pages larger than the paper are shrunk to fit.
* @param {boolean} [options.opi] - Generate OPI comments for all images and forms which have OPI information.
Expand Down Expand Up @@ -1303,15 +1303,15 @@ class Poppler {
level2Sep: { arg: "-level2sep", type: "boolean" },
level3: { arg: "-level3", type: "boolean" },
level3Sep: { arg: "-level3sep", type: "boolean" },
noCenter: { arg: "-nocenter", type: "boolean" },
noCrop: { arg: "-nocrop", type: "boolean" },
noEmbedCIDFonts: { arg: "-noembcidps", type: "boolean" },
noEmbedCIDTrueTypeFonts: {
arg: "-noembcidtt",
type: "boolean",
},
noEmbedTrueTypeFonts: { arg: "-noembtt", type: "boolean" },
noEmbedType1Fonts: { arg: "-noembt1", type: "boolean" },
noCenter: { arg: "-nocenter", type: "boolean" },
noCrop: { arg: "-nocrop", type: "boolean" },
noShrink: { arg: "-noshrink", type: "boolean" },
opi: { arg: "-opi", type: "boolean" },
optimizecolorspace: {
Expand All @@ -1327,11 +1327,11 @@ class Poppler {
passfonts: { arg: "-passfonts", type: "boolean" },
preload: { arg: "-preload", type: "boolean" },
printVersionInfo: { arg: "-v", type: "boolean" },
processColorFormat: { arg: "-processcolorformat", type: "string" },
processColorProfile: {
arg: "-processcolorprofile",
type: "string",
},
processColorFormat: { arg: "-processcolorformat", type: "string" },
quiet: { arg: "-q", type: "boolean" },
rasterize: {
arg: "-rasterize",
Expand Down
16 changes: 8 additions & 8 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,18 @@ describe("Node-Poppler module", () => {

describe("pdfInfo function", () => {
const pdfInfoObject = {
tagged: "yes",
userProperties: "no",
suspects: "no",
form: "AcroForm",
javaScript: "no",
pages: "16",
encrypted: "no",
pageSize: "595.276 x 841.89 pts (A4)",
pageRot: "0",
fileSize: "583094 bytes",
form: "AcroForm",
javaScript: "no",
optimized: "no",
pageRot: "0",
pageSize: "595.276 x 841.89 pts (A4)",
pages: "16",
pdfVersion: "1.3",
suspects: "no",
tagged: "yes",
userProperties: "no",
};

it("Lists info of PDF file", async () => {
Expand Down
26 changes: 13 additions & 13 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export class Poppler {
* @param {object} [options] - Object containing options to pass to binary.
* @param {boolean} [options.listEmbedded] - List all of the embedded files in the PDF file.
* File names are converted to the text encoding specified by `options.outputEncoding`.
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
* @param {string} [options.outputEncoding] - Sets the encoding to use for text output.
* This defaults to `UTF-8`.
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
* @param {string} [options.outputPath] - Set the file name used when saving an embedded file with
* the save option enabled, or the directory if `options.saveall` is used.
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
Expand All @@ -46,8 +46,8 @@ export class Poppler {
*/
pdfDetach(file: string, options?: {
listEmbedded?: boolean;
ownerPassword?: string;
outputEncoding?: string;
ownerPassword?: string;
outputPath?: string;
printVersionInfo?: boolean;
saveAllFiles?: boolean;
Expand Down Expand Up @@ -88,12 +88,12 @@ export class Poppler {
* @param {boolean} [options.ccittFile] - Generate CCITT images as CCITT files.
* @param {number} [options.firstPageToConvert] - Specifies the first page to convert.
* @param {number} [options.lastPageToConvert] - Specifies the last page to convert.
* @param {boolean} [options.list] - Instead of writing the images, list the
* images along with various information for each image.
* NOTE: Do not specify the outputPrefix with this option.
* @param {boolean} [options.jbig2File] - Generate JBIG2 images as JBIG2 files.
* @param {boolean} [options.jpeg2000File] - Generate JPEG2000 images at JP2 files.
* @param {boolean} [options.jpegFile] - Generate JPEG images as JPEG files.
* @param {boolean} [options.list] - Instead of writing the images, list the
* images along with various information for each image.
* NOTE: Do not specify the outputPrefix with this option.
* @param {string} [options.ownerPassword] - Owner password (for encrypted files).
* @param {boolean} [options.pngFile] - Change the default output format to PNG.
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
Expand All @@ -106,10 +106,10 @@ export class Poppler {
ccittFile?: boolean;
firstPageToConvert?: number;
lastPageToConvert?: number;
list?: boolean;
jbig2File?: boolean;
jpeg2000File?: boolean;
jpegFile?: boolean;
list?: boolean;
ownerPassword?: string;
pngFile?: boolean;
printVersionInfo?: boolean;
Expand Down Expand Up @@ -575,6 +575,11 @@ export class Poppler {
* This enables all Level 2 featuresplus CID font embedding.
* @param {boolean} [options.level3Sep] - Generate Level 3 separable PostScript.
* The separation handling is the same as for `options.level2Sep`.
* @param {boolean} [options.noCenter] - By default, PDF pages smaller than the paper
* (after any scaling) are centered on the paper. This option causes them to be aligned to
* the lower-left corner of the paper instead.
* @param {boolean} [options.noCrop] - By default, printing output is cropped to the CropBox
* specified in the PDF file. This option disables cropping.
* @param {boolean} [options.noEmbedCIDFonts] - By default, any CID PostScript fonts which are
* embedded in the PDF file are copied into the PostScript file. This option disables that embedding.
* No attempt is made to substitute for non-embedded CID PostScript fonts.
Expand All @@ -588,11 +593,6 @@ export class Poppler {
* @param {boolean} [options.noEmbedType1Fonts] - By default, any Type 1 fonts which are embedded in the PDF file
* are copied into the PostScript file. This option causes pdfToPs to substitute base fonts instead.
* Embedded fonts make PostScript files larger, but may be necessary for readable output.
* @param {boolean} [options.noCenter] - By default, PDF pages smaller than the paper
* (after any scaling) are centered on the paper. This option causes them to be aligned to
* the lower-left corner of the paper instead.
* @param {boolean} [options.noCrop] - By default, printing output is cropped to the CropBox
* specified in the PDF file. This option disables cropping.
* @param {boolean} [options.noShrink] - Do not scale PDF pages which are larger than the paper.
* By default, pages larger than the paper are shrunk to fit.
* @param {boolean} [options.opi] - Generate OPI comments for all images and forms which have OPI information.
Expand Down Expand Up @@ -654,12 +654,12 @@ export class Poppler {
level2Sep?: boolean;
level3?: boolean;
level3Sep?: boolean;
noCenter?: boolean;
noCrop?: boolean;
noEmbedCIDFonts?: boolean;
noEmbedCIDTrueTypeFonts?: boolean;
noEmbedTrueTypeFonts?: boolean;
noEmbedType1Fonts?: boolean;
noCenter?: boolean;
noCrop?: boolean;
noShrink?: boolean;
opi?: boolean;
optimizecolorspace?: boolean;
Expand Down

0 comments on commit f0dc8b8

Please sign in to comment.