Skip to content

Commit

Permalink
docs(api): add stdout usage for pdftotext, pdftocairo, and pdftops funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Frazer Smith committed Oct 12, 2020
1 parent bfea135 commit bd05f63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Converts a PDF file to PNG/JPEG/TIFF/PDF/PS/EPS/SVG.
| [options.transparentPageColor] | <code>boolean</code> | Use a transparent page color instead of white (PNG and TIFF only). |
| [options.userPassword] | <code>string</code> | Specify the user password for the PDF file. |
| file | <code>string</code> | Filepath of the PDF file to read. |
| [outputFile] | <code>string</code> | Filepath of the file to output the results to. |
| [outputFile] | <code>string</code> | Filepath of the file to output the results to. Can be set to `'-'` to write output to stdout. Using stdout is not valid with image formats unless `options.singleFile` is set to `true`. If not set then the output filename will be derived from the PDF file name. |

<a name="Poppler+pdfToHtml"></a>

Expand Down Expand Up @@ -386,7 +386,7 @@ Converts a PDF file to PostScript (PS).
| [options.resolutionXYAxis] | <code>number</code> | Specifies the X and Y resolution, in pixels per inch of image files (or rasterized regions in vector output). The default is 300 PPI. |
| [options.userPassword] | <code>string</code> | User password (for encrypted files). |
| file | <code>string</code> | Filepath of the PDF file to read. |
| [outputFile] | <code>string</code> | Filepath of the file to output the results to. |
| [outputFile] | <code>string</code> | Filepath of the file to output the results to. Can be set to `'-'` to write output to stdout. |

<a name="Poppler+pdfToText"></a>

Expand Down Expand Up @@ -423,7 +423,7 @@ Converts a PDF file to TXT.
| [options.rawLayout] | <code>boolean</code> | Keep the text in content stream order. This is a hack which often undoes column formatting, etc. Use of raw mode is no longer recommended. |
| [options.userPassword] | <code>string</code> | User password (for encrypted files). |
| file | <code>string</code> | Filepath of the PDF file to read. |
| [outputFile] | <code>string</code> | Filepath of the file to output the results to. |
| [outputFile] | <code>string</code> | Filepath of the file to output the results to. Can be set to `'-'` to write output to stdout. |

<a name="Poppler+pdfUnite"></a>

Expand Down
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ class Poppler {
* @param {string=} options.userPassword - Specify the user password for the PDF file.
* @param {string} file - Filepath of the PDF file to read.
* @param {string=} outputFile - Filepath of the file to output the results to.
*
* Can be set to `'-'` to write output to stdout. Using stdout is not valid with image formats
* unless `options.singleFile` is set to `true`.
*
* If not set then the output filename will be derived from the PDF file name.
* @returns {Promise<string|Error>} Promise of stdout string on resolve, or Error object on rejection.
*/
async pdfToCairo(options = {}, file, outputFile) {
Expand Down Expand Up @@ -812,6 +817,7 @@ class Poppler {
* @param {string=} options.userPassword - User password (for encrypted files).
* @param {string} file - Filepath of the PDF file to read.
* @param {string=} outputFile - Filepath of the file to output the results to.
* Can be set to `'-'` to write output to stdout.
* @returns {Promise<string|Error>} Promise of stdout string on resolve, or Error object on rejection.
*/
async pdfToPs(options = {}, file, outputFile) {
Expand Down Expand Up @@ -921,6 +927,7 @@ class Poppler {
* @param {string=} options.userPassword - User password (for encrypted files).
* @param {string} file - Filepath of the PDF file to read.
* @param {string=} outputFile - Filepath of the file to output the results to.
* Can be set to `'-'` to write output to stdout.
* @returns {Promise<string|Error>} Promise of stdout string on resolve, or Error object on rejection.
*/
async pdfToText(options = {}, file, outputFile) {
Expand Down

0 comments on commit bd05f63

Please sign in to comment.