Skip to content

Commit

Permalink
feat(index): add printDocStruct option to pdfToCairo
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Nov 3, 2023
1 parent c02f9aa commit f6d2e2a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ Converts a PDF file to EPS/JPEG/PDF/PNG/PS/SVG/TIFF.
| [options.pdfFile] | <code>boolean</code> | Generate PDF file. |
| [options.pngFile] | <code>boolean</code> | Generate PNG file(s). |
| [options.printVersionInfo] | <code>boolean</code> | Print copyright and version information. |
| [options.printDocStruct] | <code>boolean</code> | If the input file contains structural information about the document's content, write this information to the output file (PDF only). |
| [options.psFile] | <code>boolean</code> | Generate PS file. |
| [options.psLevel2] | <code>boolean</code> | Generate Level 2 PostScript (PS only). |
| [options.psLevel3] | <code>boolean</code> | Generate Level 3 PostScript (PS only). This enables all Level 2 features plus shading patterns and masked images. This is the default setting. |
Expand Down
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,8 @@ class Poppler {
* @param {boolean} [options.pdfFile] - Generate PDF file.
* @param {boolean} [options.pngFile] - Generate PNG file(s).
* @param {boolean} [options.printVersionInfo] - Print copyright and version information.
* @param {boolean} [options.printDocStruct] - If the input file contains structural information
* about the document's content, write this information to the output file (PDF only).
* @param {boolean} [options.psFile] - Generate PS file.
* @param {boolean} [options.psLevel2] - Generate Level 2 PostScript (PS only).
* @param {boolean} [options.psLevel3] - Generate Level 3 PostScript (PS only). This enables all
Expand Down Expand Up @@ -726,6 +728,11 @@ class Poppler {
paperWidth: { arg: "-paperw", type: "number" },
pdfFile: { arg: "-pdf", type: "boolean" },
pngFile: { arg: "-png", type: "boolean" },
printDocStruct: {
arg: "-struct",
type: "boolean",
minVersion: "23.11.0",
},
printVersionInfo: { arg: "-v", type: "boolean" },
psFile: { arg: "-ps", type: "boolean" },
psLevel2: { arg: "-level2", type: "boolean" },
Expand Down
3 changes: 3 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ export class Poppler {
* @param {boolean} [options.pdfFile] - Generate PDF file.
* @param {boolean} [options.pngFile] - Generate PNG file(s).
* @param {boolean} [options.printVersionInfo] - Print copyright and version information.
* @param {boolean} [options.printDocStruct] - If the input file contains structural information
* about the document's content, write this information to the output file (PDF only).
* @param {boolean} [options.psFile] - Generate PS file.
* @param {boolean} [options.psLevel2] - Generate Level 2 PostScript (PS only).
* @param {boolean} [options.psLevel3] - Generate Level 3 PostScript (PS only). This enables all
Expand Down Expand Up @@ -360,6 +362,7 @@ export class Poppler {
pdfFile?: boolean;
pngFile?: boolean;
printVersionInfo?: boolean;
printDocStruct?: boolean;
psFile?: boolean;
psLevel2?: boolean;
psLevel3?: boolean;
Expand Down

0 comments on commit f6d2e2a

Please sign in to comment.